Skip to content

Commit

Permalink
fix: don't set inactive to old server, because there will be one at h…
Browse files Browse the repository at this point in the history
…ome, one at work

fixes #67
  • Loading branch information
linonetwo committed Dec 1, 2024
1 parent fd07905 commit f918f15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/store/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const useWorkspaceStore = create<WikiState & WikiActions>()(
// get latest existing server last sync, if haven't sync to any server before, use LAST_SYNC_TO_SYNC_ALL
const lastSync = oldWiki.syncedServers.sort((a, b) => b.lastSync - a.lastSync)[0]?.lastSync ?? LAST_SYNC_TO_SYNC_ALL;
console.log(`Add new server to wiki ${oldWiki.name} with last sync ${lastSync} to server ${newServerID}`);
const updatedServers = [...oldWiki.syncedServers.map(oldServers => ({ ...oldServers, syncActive: false })), {
const updatedServers = [...oldWiki.syncedServers, {
serverID: newServerID,
lastSync,
syncActive: true,
Expand Down

0 comments on commit f918f15

Please sign in to comment.