fix: title updated without needless calls

This commit is contained in:
Arman committed 2022-07-29 15:10:51 +02:00
1 parent 6288480082
commit de32d858d8
4 files changed
+4 -8

No files matched your search

@@ -41,10 +41,6 @@
]
});
}
$: if ($team.name) {
handle();
}
</script>
<svelte:head>
@@ -7,6 +7,7 @@
import { toLocaleDateTime } from '$lib/helpers/date';
import { addNotification } from '$lib/stores/notifications';
import { team } from './store';
import { title } from '$lib/stores/layout';
import DeleteTeam from './_deleteTeam.svelte';
import { onMount } from 'svelte';
@@ -33,6 +34,7 @@
try {
await sdkForProject.teams.update($page.params.team, teamName);
$team.name = teamName;
title.set(teamName);
addNotification({
message: 'Name has been updated',
type: 'success'
@@ -45,10 +45,6 @@
]
});
}
$: if ($user.name) {
handle();
}
</script>
<svelte:head>
@@ -17,6 +17,7 @@
import DeleteUser from './_deleteUser.svelte';
import { user } from './store';
import { onMount } from 'svelte';
import { title } from '$lib/stores/layout';
$: if (prefs) {
if (JSON.stringify(prefs) !== JSON.stringify(Object.entries($user.prefs))) {
@@ -111,6 +112,7 @@
try {
await sdkForProject.users.updateName($user.$id, userName);
$user.name = userName;
title.set(userName);
showError = false;
addNotification({
message: 'Name has been updated',