fix lint
This commit is contained in:
parent
906f1f4a87
commit
661082303d
|
@ -20,13 +20,13 @@ export async function signout() {
|
||||||
|
|
||||||
//#region Remove account
|
//#region Remove account
|
||||||
const accounts = await getAccounts();
|
const accounts = await getAccounts();
|
||||||
accounts.splice(accounts.findIndex(x => x.id === $i.id), 1)
|
accounts.splice(accounts.findIndex(x => x.id === $i.id), 1);
|
||||||
set('accounts', JSON.stringify(accounts));
|
set('accounts', JSON.stringify(accounts));
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Remove push notification registration
|
//#region Remove push notification registration
|
||||||
await navigator.serviceWorker.ready.then(async r => {
|
await navigator.serviceWorker.ready.then(async r => {
|
||||||
const push = await r.pushManager.getSubscription()
|
const push = await r.pushManager.getSubscription();
|
||||||
if (!push) return;
|
if (!push) return;
|
||||||
return fetch(`${apiUrl}/sw/unregister`, {
|
return fetch(`${apiUrl}/sw/unregister`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -91,7 +91,7 @@ export function refreshAccount() {
|
||||||
fetchAccount($i.token).then(updateAccount);
|
fetchAccount($i.token).then(updateAccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function login(token: Account['token'], showTimeline?: boolean) {
|
export async function login(token: Account['token'], showTimeline: boolean = false) {
|
||||||
waiting();
|
waiting();
|
||||||
if (_DEV_) console.log('logging as token ', token);
|
if (_DEV_) console.log('logging as token ', token);
|
||||||
const me = await fetchAccount(token);
|
const me = await fetchAccount(token);
|
||||||
|
|
|
@ -116,7 +116,7 @@ self.addEventListener('notificationclick', ev => {
|
||||||
self.addEventListener('notificationclose', async ev => {
|
self.addEventListener('notificationclose', async ev => {
|
||||||
self.registration.showNotification('notificationclose');
|
self.registration.showNotification('notificationclose');
|
||||||
const { notification } = ev;
|
const { notification } = ev;
|
||||||
const { data } = notification
|
const { data } = notification;
|
||||||
|
|
||||||
if (data.isNotification) {
|
if (data.isNotification) {
|
||||||
const { origin } = location;
|
const { origin } = location;
|
||||||
|
|
Loading…
Reference in New Issue