Skip to content

Commit

Permalink
add APP_NAME to app title
Browse files Browse the repository at this point in the history
  • Loading branch information
zlayine committed Oct 24, 2023
1 parent e1b20e0 commit ec9896c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion resources/js/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ const router = useRouter();
const canaryHost = computed(() => appStore.config.network === 'canary');
(() => {
if (!canaryHost.value) {
if (window.bootstrap.name) {
return;
}
if (canaryHost.value) {
document.title = 'Canary Enjin Platform';
} else {
document.title = 'Enjin Platform';
Expand Down
1 change: 1 addition & 0 deletions resources/js/shims-vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ interface Window {
bootstrap: {
url: string;
daemon: string;
name: string;
};
}
4 changes: 4 additions & 0 deletions resources/js/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ export const useAppStore = defineStore('app', {
if (window.bootstrap?.daemon) {
this.config.daemon = window.bootstrap.daemon;
}

if (window.bootstrap?.name) {
document.title = window.bootstrap.name;
}
},
async checkURL(url: URL) {
try {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script>
global = globalThis
window.__dynamic_base__ = '/vendor/platform-ui/build';
window.bootstrap = { url: window.location.origin, daemon: "{{ Enjin\Platform\Support\Account::daemon()['public_key'] }}" }
window.bootstrap = { name: "{{ env('APP_NAME') }}", url: window.location.origin, daemon: "{{ Enjin\Platform\Support\Account::daemon()['public_key'] }}" }
</script>

@vite('resources/js/app.ts', 'vendor/platform-ui/build')
Expand Down

0 comments on commit ec9896c

Please sign in to comment.