Skip to content

Commit

Permalink
fix: don't add timestamp to $:/config/SyncSystemTiddlersFromServer
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed May 22, 2024
1 parent 18331f8 commit bb4f2db
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/commandpalette/widgets/utils/filterTiddlersAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export async function filterTiddlersAsync(filter: string, system?: boolean, excl
if (isInTidGiDesktop && 'service' in window) {
// by default tiddlyweb protocol omit all system tiddlers, need to turn off this // TODO: add param to turn off this in TidGi
const wikiServer = (window.service as any).wiki;
let previousServerConfigValue = 'no';
let previousServerConfigValue: string | undefined;
if (system === true) {
previousServerConfigValue = await wikiServer.wikiOperationInServer('wiki-get-tiddler-text', tidGiWorkspaceID, ['$:/config/SyncSystemTiddlersFromServer']);
await wikiServer.wikiOperationInServer('wiki-set-tiddler-text', tidGiWorkspaceID, [
await wikiServer.wikiOperationInServer('wiki-add-tiddler', tidGiWorkspaceID, [
'$:/config/SyncSystemTiddlersFromServer',
'yes',
]);
Expand All @@ -23,10 +23,16 @@ export async function filterTiddlersAsync(filter: string, system?: boolean, excl
exclude,
);
if (system === true) {
await wikiServer.wikiOperationInServer('wiki-set-tiddler-text', tidGiWorkspaceID, [
'$:/config/SyncSystemTiddlersFromServer',
previousServerConfigValue,
]);
if (previousServerConfigValue === undefined) {
await wikiServer.wikiOperationInServer('wiki-delete-tiddler', tidGiWorkspaceID, [
'$:/config/SyncSystemTiddlersFromServer',
]);
} else {
await wikiServer.wikiOperationInServer('wiki-add-tiddler', tidGiWorkspaceID, [
'$:/config/SyncSystemTiddlersFromServer',
previousServerConfigValue,
]);
}
}
return resultFromIPC.data as ITiddlerFields[];
} else {
Expand Down

0 comments on commit bb4f2db

Please sign in to comment.