mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 22:07:09 +08:00
Merge pull request #886 from toeverything/feat/sync-status
fix: logout will jump to 404 error
This commit is contained in:
@@ -430,7 +430,7 @@ export class AffineProvider extends BaseProvider {
|
||||
token.clear();
|
||||
this._channel?.disconnect();
|
||||
this._wsMap.forEach(ws => ws.disconnect());
|
||||
this._workspaces.clear();
|
||||
this._workspaces.clear(false);
|
||||
storage.removeItem('token');
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ export interface WorkspaceUnitCollectionScope {
|
||||
get: (workspaceId: string) => WorkspaceUnit | undefined;
|
||||
list: () => WorkspaceUnit[];
|
||||
add: (workspace: WorkspaceUnit | WorkspaceUnit[]) => void;
|
||||
remove: (workspaceId: string | string[]) => boolean;
|
||||
clear: () => void;
|
||||
remove: (workspaceId: string | string[], isUpdate?: boolean) => boolean;
|
||||
clear: (isUpdate?: boolean) => void;
|
||||
update: (
|
||||
workspaceId: string,
|
||||
workspaceUnit: UpdateWorkspaceUnitParams
|
||||
@@ -85,7 +85,7 @@ export class WorkspaceUnitCollection {
|
||||
]);
|
||||
};
|
||||
|
||||
const remove = (workspaceId: string | string[]) => {
|
||||
const remove = (workspaceId: string | string[], isUpdate = true) => {
|
||||
const workspaceIds = Array.isArray(workspaceId)
|
||||
? workspaceId
|
||||
: [workspaceId];
|
||||
@@ -111,18 +111,19 @@ export class WorkspaceUnitCollection {
|
||||
if (!workspaceUnits.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this._events.emit('change', [
|
||||
{
|
||||
deleted: workspaceUnits,
|
||||
} as WorkspaceUnitCollectionChangeEvent,
|
||||
]);
|
||||
if (isUpdate) {
|
||||
this._events.emit('change', [
|
||||
{
|
||||
deleted: workspaceUnits,
|
||||
} as WorkspaceUnitCollectionChangeEvent,
|
||||
]);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const clear = () => {
|
||||
remove(Array.from(scopedWorkspaceIds));
|
||||
const clear = (isUpdate = true) => {
|
||||
remove(Array.from(scopedWorkspaceIds), isUpdate);
|
||||
};
|
||||
|
||||
const update = (workspaceId: string, meta: UpdateWorkspaceUnitParams) => {
|
||||
|
||||
Reference in New Issue
Block a user