feat: integrate client and server sharing workflows

This commit is contained in:
justme committed 2026-10-02 10:49:45 +08:00
1 parent 42b93ae2d8
commit 7406e2fe37
101 files changed
+3153 -253

No files matched your search

@@ -68,3 +68,15 @@
font-size: 18px;
pointer-events: none;
}
.error {
position: fixed;
top: var(--bar-h);
left: var(--space-4);
right: var(--space-4);
z-index: 20;
padding: var(--space-3);
background: var(--surface);
color: var(--danger);
border: 1px solid var(--danger);
}
+3 -4
View File
@@ -33,6 +33,7 @@ export function Workspace() {
const sendFiles = useWorkspace((s) => s.sendFiles);
const sendText = useWorkspace((s) => s.sendText);
const remove = useWorkspace((s) => s.remove);
const error = useWorkspace((s) => s.error);
const download = useDownload();
// 刚创建的频道:直接展示分享面板和二维码,让对方马上能扫
@@ -61,10 +62,7 @@ export function Workspace() {
// 从首页「快速分享」带过来的内容,进入频道后发送
useEffect(() => {
const { consumePayload, clearJustCreated } = useChannels.getState();
const p = consumePayload();
if (p) sendPayload(p);
clearJustCreated();
useChannels.getState().clearJustCreated();
}, [sendPayload]);
const ids = useWorkspace(
@@ -192,6 +190,7 @@ export function Workspace() {
</div>
)}
{error ? <div className={styles.error} role="alert">{error}</div> : null}
{!desktop && panelOpen ? (
<Sheet title="设备与分享" onClose={closePanel}>
<DevicePanel qrOpen={justCreated} />