feat: added a profile settings and settings nav (#432)
This commit is contained in:
parent
c8a7e6e7e7
commit
613c5315b3
23 changed files with 698 additions and 7 deletions
|
@ -103,6 +103,24 @@ async function loginTo(user?: Omit<UserLogin, 'account'> & { account?: AccountCr
|
|||
return masto
|
||||
}
|
||||
|
||||
export function setAccountInfo(userId: string, account: AccountCredentials) {
|
||||
const index = getUsersIndexByUserId(userId)
|
||||
if (index === -1)
|
||||
return false
|
||||
|
||||
users.value[index].account = account
|
||||
return true
|
||||
}
|
||||
|
||||
export async function pullMyAccountInfo() {
|
||||
const me = await useMasto().accounts.verifyCredentials()
|
||||
setAccountInfo(currentUserId.value, me)
|
||||
}
|
||||
|
||||
export function getUsersIndexByUserId(userId: string) {
|
||||
return users.value.findIndex(u => u.account?.id === userId)
|
||||
}
|
||||
|
||||
export async function removePushNotificationData(user: UserLogin, fromSWPushManager = true) {
|
||||
// clear push subscription
|
||||
user.pushSubscription = undefined
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue