Added docs (and observations) to notes count.
This commit is contained in:
parent
a2dc196a07
commit
8cca5f0001
|
@ -56,13 +56,32 @@ export function signinRequired() {
|
||||||
return $i;
|
return $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the current number of notes from the current account.
|
||||||
|
*
|
||||||
|
* Note: This appears to only be used for the "notes1" achievement.
|
||||||
|
*
|
||||||
|
* Also, separating it like this might cause counts to get out-of-sync.
|
||||||
|
*/
|
||||||
export let notesCount = $i == null ? 0 : $i.notesCount;
|
export let notesCount = $i == null ? 0 : $i.notesCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increments the number of notes by one.
|
||||||
|
*
|
||||||
|
* Documentation TODO: What about $i.notesCount? Why not increment that?
|
||||||
|
*/
|
||||||
export function incNotesCount() {
|
export function incNotesCount() {
|
||||||
notesCount++;
|
notesCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function signout() {
|
export async function signout() {
|
||||||
if (!$i) return;
|
|
||||||
|
// If we're not signed in, there's nothing to do.
|
||||||
|
if (!$i) {
|
||||||
|
// Error log:
|
||||||
|
console.error('signout() called when not signed in');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
waiting();
|
waiting();
|
||||||
miLocalStorage.removeItem('account');
|
miLocalStorage.removeItem('account');
|
||||||
|
|
Loading…
Reference in a new issue