refactor: move logic for default icon navbar itself
This commit is contained in:
parent
89150a6cc6
commit
eb4427ff4b
2 changed files with 6 additions and 2 deletions
|
@ -13,6 +13,8 @@
|
||||||
<DefaultIcon v-else-if="props.contextName && props.guildUuid"
|
<DefaultIcon v-else-if="props.contextName && props.guildUuid"
|
||||||
class="context-icon"
|
class="context-icon"
|
||||||
:name="props.contextName" :seed="props.guildUuid"/>
|
:name="props.contextName" :seed="props.guildUuid"/>
|
||||||
|
<NuxtImg v-else
|
||||||
|
:src="defaultIcon" />
|
||||||
|
|
||||||
<div class="context-title">
|
<div class="context-title">
|
||||||
{{ props.contextName }}
|
{{ props.contextName }}
|
||||||
|
@ -32,6 +34,9 @@ import type { NavbarInterface, NavbarItem } from '~/types/interfaces';
|
||||||
|
|
||||||
const props = defineProps<NavbarInterface>();
|
const props = defineProps<NavbarInterface>();
|
||||||
|
|
||||||
|
const runtimeConfig = useRuntimeConfig();
|
||||||
|
const defaultIcon = `${runtimeConfig.app.baseURL}/icon.svg`
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
@ -45,10 +45,9 @@ onActivated(async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
function updateNavbar() {
|
function updateNavbar() {
|
||||||
const runtimeConfig = useRuntimeConfig();
|
|
||||||
navbar.value.channelItems = []
|
navbar.value.channelItems = []
|
||||||
navbar.value.contextName = "Direct Messages"
|
navbar.value.contextName = "Direct Messages"
|
||||||
navbar.value.contextIcon = `${runtimeConfig.app.baseURL}/icon.svg`
|
navbar.value.contextIcon = undefined
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue