Skip to content

Commit

Permalink
chore: show different loading message when there is no cached note yet
Browse files Browse the repository at this point in the history
  • Loading branch information
logotip4ik committed Oct 27, 2024
1 parent 41fce7f commit 323083a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pages/@[user]/[...folders]/[note].vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ async function fetchNote(): Promise<void> {
lastRefetch = Date.now();
loadingToast = createToast('This is cached note, wait for new one to arrive...', {
delay: parseDuration('3 seconds'),
type: 'loading',
});
let hydrationPromise = getHydrationPromise();
$fetch(`/api/note${noteApiPath.value}`, { signal: abortControllerGet.signal })
Expand Down Expand Up @@ -78,6 +73,17 @@ async function fetchNote(): Promise<void> {
hydrationPromise = undefined;
}
loadingToast = createToast(
cachedNote
? 'This is cached note, wait for new one to arrive...'
: 'This shouldn\'t take a long time...',
{
delay: parseDuration('3 seconds'),
type: 'loading',
duration: Infinity,
},
);
note.value = cachedNote;
}
Expand Down

0 comments on commit 323083a

Please sign in to comment.