chore: inline simple helper (#2631)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2631 Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
parent
98cb878250
commit
e49f960aea
@ -1,6 +0,0 @@
|
||||
// https://stackoverflow.com/a/32108184/10924593
|
||||
export function objectIsEmpty(obj: Record<string, unknown>): boolean {
|
||||
return obj
|
||||
&& Object.keys(obj).length === 0
|
||||
&& Object.getPrototypeOf(obj) === Object.prototype
|
||||
}
|
@ -162,7 +162,6 @@ import {SUPPORTED_LOCALES} from '@/i18n'
|
||||
import {playSoundWhenDoneKey, playPopSound} from '@/helpers/playPop'
|
||||
import {getQuickAddMagicMode, setQuickAddMagicMode} from '@/helpers/quickAddMagicMode'
|
||||
import {createRandomID} from '@/helpers/randomId'
|
||||
import {objectIsEmpty} from '@/helpers/objectIsEmpty'
|
||||
import {success} from '@/message'
|
||||
import {AuthenticatedHTTPFactory} from '@/helpers/fetcher'
|
||||
|
||||
@ -235,8 +234,8 @@ const availableLanguageOptions = ref(
|
||||
watch(
|
||||
() => authStore.settings,
|
||||
() => {
|
||||
// Only setting if we don't have values set yet to avoid overriding edited values
|
||||
if (!objectIsEmpty(settings.value)) {
|
||||
// Only set setting if we don't have edited values yet to avoid overriding
|
||||
if (Object.keys(settings.value).length !== 0) {
|
||||
return
|
||||
}
|
||||
settings.value = {...authStore.settings}
|
||||
|
Loading…
x
Reference in New Issue
Block a user