refactor(client): refactor dialog functions to improve type inference
This commit is contained in:
@@ -171,16 +171,15 @@ export default defineComponent({
|
||||
userId: this.user.id,
|
||||
});
|
||||
|
||||
os.dialog({
|
||||
os.alert({
|
||||
type: 'success',
|
||||
text: this.$t('newPasswordIs', { password })
|
||||
});
|
||||
},
|
||||
|
||||
async toggleSilence(v) {
|
||||
const confirm = await os.dialog({
|
||||
const confirm = await os.confirm({
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
text: v ? this.$ts.silenceConfirm : this.$ts.unsilenceConfirm,
|
||||
});
|
||||
if (confirm.canceled) {
|
||||
@@ -192,9 +191,8 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
async toggleSuspend(v) {
|
||||
const confirm = await os.dialog({
|
||||
const confirm = await os.confirm({
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
text: v ? this.$ts.suspendConfirm : this.$ts.unsuspendConfirm,
|
||||
});
|
||||
if (confirm.canceled) {
|
||||
@@ -211,9 +209,8 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
async deleteAllFiles() {
|
||||
const confirm = await os.dialog({
|
||||
const confirm = await os.confirm({
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
text: this.$ts.deleteAllFilesConfirm,
|
||||
});
|
||||
if (confirm.canceled) return;
|
||||
@@ -222,7 +219,7 @@ export default defineComponent({
|
||||
os.success();
|
||||
};
|
||||
await process().catch(e => {
|
||||
os.dialog({
|
||||
os.alert({
|
||||
type: 'error',
|
||||
text: e.toString()
|
||||
});
|
||||
|
Reference in New Issue
Block a user