Do not flash profile edit buttons while profile is still loading
This commit is contained in:
@@ -152,9 +152,13 @@ async function onTwoFADisable() {
|
||||
|
||||
// Init
|
||||
onMounted(async () => {
|
||||
let [error, result] = await dashboardModel.config();
|
||||
if (error) return console.error(error);
|
||||
config.value = result;
|
||||
|
||||
await refreshProfile();
|
||||
|
||||
let [error, result] = await cloudronModel.languages();
|
||||
[error, result] = await cloudronModel.languages();
|
||||
languages.value = result.map(l => {
|
||||
return {
|
||||
id: l,
|
||||
@@ -167,10 +171,6 @@ onMounted(async () => {
|
||||
const usedLang = window.localStorage.NG_TRANSLATE_LANG_KEY || 'en';
|
||||
language.value = languages.value.find(l => l.id === usedLang).id;
|
||||
|
||||
[error, result] = await dashboardModel.config();
|
||||
if (error) return console.error(error);
|
||||
config.value = result;
|
||||
|
||||
[error, result] = await tokensModel.list();
|
||||
if (error) return console.error(error);
|
||||
|
||||
@@ -237,7 +237,7 @@ onMounted(async () => {
|
||||
<div>{{ user.displayName }}</div>
|
||||
</FormGroup>
|
||||
<div style="display: flex; align-items: center">
|
||||
<Button tool plain @click="onChangeDisplayName(user.displayName)" v-show="!user.source && !config.profileLocked">{{ $t('main.dialog.edit') }}</Button>
|
||||
<Button tool plain @click="onChangeDisplayName(user.displayName)" v-show="user.username && !user.source && !config.profileLocked">{{ $t('main.dialog.edit') }}</Button>
|
||||
</div>
|
||||
</SettingsItem>
|
||||
|
||||
@@ -247,7 +247,7 @@ onMounted(async () => {
|
||||
<div>{{ user.email }}</div>
|
||||
</FormGroup>
|
||||
<div style="display: flex; align-items: center">
|
||||
<Button tool plain @click="onChangeEmail(user.email)" v-show="!user.source && !config.profileLocked">{{ $t('main.dialog.edit') }}</Button>
|
||||
<Button tool plain @click="onChangeEmail(user.email)" v-show="user.username && !user.source && !config.profileLocked">{{ $t('main.dialog.edit') }}</Button>
|
||||
</div>
|
||||
</SettingsItem>
|
||||
|
||||
@@ -257,7 +257,7 @@ onMounted(async () => {
|
||||
<div>{{ user.fallbackEmail || 'unset' }}</div>
|
||||
</FormGroup>
|
||||
<div style="display: flex; align-items: center">
|
||||
<Button tool plain @click="onChangeFallbackEmail(user.fallbackEmail)" v-show="!user.source && !config.profileLocked">{{ $t('main.dialog.edit') }}</Button>
|
||||
<Button tool plain @click="onChangeFallbackEmail(user.fallbackEmail)" v-show="user.username && !user.source && !config.profileLocked">{{ $t('main.dialog.edit') }}</Button>
|
||||
</div>
|
||||
</SettingsItem>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user