Added docs (and observations) to notes count.
This commit is contained in:
parent
ecb990fb77
commit
aeb568664d
|
@ -56,13 +56,32 @@ export function signinRequired() {
|
|||
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;
|
||||
|
||||
/**
|
||||
* Increments the number of notes by one.
|
||||
*
|
||||
* Documentation TODO: What about $i.notesCount? Why not increment that?
|
||||
*/
|
||||
export function incNotesCount() {
|
||||
notesCount++;
|
||||
}
|
||||
|
||||
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();
|
||||
miLocalStorage.removeItem('account');
|
||||
|
|
Loading…
Reference in a new issue