More hotfixes to app passwords (#511)
* Fix app passwords modal on web * Fix delete app password on webzio/stable
parent
16124b5081
commit
af2fd3cf29
|
@ -18,6 +18,7 @@ import * as AltTextImageModal from './AltImage'
|
||||||
import * as ChangeHandleModal from './ChangeHandle'
|
import * as ChangeHandleModal from './ChangeHandle'
|
||||||
import * as WaitlistModal from './Waitlist'
|
import * as WaitlistModal from './Waitlist'
|
||||||
import * as InviteCodesModal from './InviteCodes'
|
import * as InviteCodesModal from './InviteCodes'
|
||||||
|
import * as AddAppPassword from './AddAppPasswords'
|
||||||
import * as ContentFilteringSettingsModal from './ContentFilteringSettings'
|
import * as ContentFilteringSettingsModal from './ContentFilteringSettings'
|
||||||
|
|
||||||
export const ModalsContainer = observer(function ModalsContainer() {
|
export const ModalsContainer = observer(function ModalsContainer() {
|
||||||
|
@ -77,6 +78,8 @@ function Modal({modal}: {modal: ModalIface}) {
|
||||||
element = <WaitlistModal.Component />
|
element = <WaitlistModal.Component />
|
||||||
} else if (modal.name === 'invite-codes') {
|
} else if (modal.name === 'invite-codes') {
|
||||||
element = <InviteCodesModal.Component />
|
element = <InviteCodesModal.Component />
|
||||||
|
} else if (modal.name === 'add-app-password') {
|
||||||
|
element = <AddAppPassword.Component />
|
||||||
} else if (modal.name === 'content-filtering-settings') {
|
} else if (modal.name === 'content-filtering-settings') {
|
||||||
element = <ContentFilteringSettingsModal.Component />
|
element = <ContentFilteringSettingsModal.Component />
|
||||||
} else if (modal.name === 'alt-text-image') {
|
} else if (modal.name === 'alt-text-image') {
|
||||||
|
|
|
@ -159,24 +159,31 @@ function AppPassword({
|
||||||
const store = useStores()
|
const store = useStores()
|
||||||
|
|
||||||
const onDelete = React.useCallback(async () => {
|
const onDelete = React.useCallback(async () => {
|
||||||
Alert.alert(
|
if (isDesktopWeb) {
|
||||||
'Delete App Password',
|
if (confirm('Delete app password?')) {
|
||||||
`Are you sure you want to delete the app password "${name}"?`,
|
await store.me.deleteAppPassword(name)
|
||||||
[
|
Toast.show('App password deleted')
|
||||||
{
|
}
|
||||||
text: 'Cancel',
|
} else {
|
||||||
style: 'cancel',
|
Alert.alert(
|
||||||
},
|
'Delete App Password',
|
||||||
{
|
`Are you sure you want to delete the app password "${name}"?`,
|
||||||
text: 'Delete',
|
[
|
||||||
style: 'destructive',
|
{
|
||||||
onPress: async () => {
|
text: 'Cancel',
|
||||||
await store.me.deleteAppPassword(name)
|
style: 'cancel',
|
||||||
Toast.show('App password deleted')
|
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
],
|
text: 'Delete',
|
||||||
)
|
style: 'destructive',
|
||||||
|
onPress: async () => {
|
||||||
|
await store.me.deleteAppPassword(name)
|
||||||
|
Toast.show('App password deleted')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
)
|
||||||
|
}
|
||||||
}, [store, name])
|
}, [store, name])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue