mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: displayNames
This commit is contained in:
1 parent
4bb7332a8b
commit
ad46fa1f6c
1 file changed
+2
-7
+2
-7
@@ -7,19 +7,14 @@
|
||||
import { last, symmetricDifference } from '$lib/helpers/array';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { onMount } from 'svelte';
|
||||
import { attributes } from '../store';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
const collectionId = $page.params.collection;
|
||||
let names: string[] = [];
|
||||
let names: string[] = [...(preferences.getDisplayNames()?.[collectionId] ?? [])];
|
||||
let search: string;
|
||||
|
||||
onMount(async () => {
|
||||
names = [...(preferences.getDisplayNames()?.[collectionId] ?? [])];
|
||||
});
|
||||
|
||||
async function updateDisplayName() {
|
||||
try {
|
||||
await preferences.setDisplayNames(collectionId, names);
|
||||
@@ -58,7 +53,7 @@
|
||||
|
||||
$: updateBtnDisabled =
|
||||
!symmetricDifference(names, preferences.getDisplayNames()?.[collectionId] ?? [])?.length ||
|
||||
!last(names);
|
||||
(names?.length && !last(names));
|
||||
</script>
|
||||
|
||||
<Form onSubmit={updateDisplayName}>
|
||||
|
||||
Reference in new issue
Block a user