Skip to content

Commit

Permalink
chore: sync issue
Browse files Browse the repository at this point in the history
  • Loading branch information
islxyqwe committed Jun 28, 2024
1 parent b3e7396 commit b890467
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class PhotesIOPlugin extends Plugin {

this.addRibbonIcon(
"camera",
"Generate notes from photos",
Platform.isMobile ? "Generate notes from photos" : "Generate notes",
async (evt: MouseEvent) => {
if (!this.settings.accessToken) {
this.openSetting();
Expand Down
2 changes: 1 addition & 1 deletion src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const downloadAssets =
await app.vault.delete(file);
}
}
} else if (filename === `!-${ending}.md`) {
} else if (filename === `!-${ending}`) {
// should edit exist file, return if not exist
return;
}
Expand Down
14 changes: 5 additions & 9 deletions src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ export async function listenSync(
const item = payload.new as INotebook;
switch (payload.eventType) {
case "INSERT":
// Do nothing because notebook is empty.
break;
case "UPDATE": {
if (item.deleted_at) {
removeNotebook(
Expand All @@ -119,13 +117,11 @@ export async function listenSync(
);
break;
}
if (item.note_orders) {
updateNotebook({
notebook_id: item.id,
title: item.title,
updated_at: item.updated_at,
});
}
updateNotebook({
notebook_id: item.id,
title: item.title,
updated_at: item.updated_at,
});
break;
}
}
Expand Down

0 comments on commit b890467

Please sign in to comment.