-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d13549
commit 8293613
Showing
6 changed files
with
126 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
<script setup> | ||
import Navbar from "@/components/global/Navbar.vue"; | ||
import { RouterView } from "vue-router"; | ||
import { provide, ref } from "vue"; | ||
import { onMounted, provide, ref } from "vue"; | ||
import useOctokitStore from "@/stores/octokit.js"; | ||
import { initOctokit } from "@/api/index.js"; | ||
import { useLoader } from "@/helpers/index.js"; | ||
const navButtonConfig = ref({}); | ||
const isOctokitInitialised = ref(false); | ||
provide("set-nav-button-config", navButtonConfig); | ||
onMounted(async () => { | ||
const loader = useLoader().show(); | ||
const instance = await initOctokit(); | ||
const octokitStore = useOctokitStore(); | ||
octokitStore.setOctokit(instance); | ||
isOctokitInitialised.value = true; | ||
loader.hide(); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<v-app> | ||
<vue-progress-bar></vue-progress-bar> | ||
<Navbar /> | ||
<v-main> | ||
<RouterView /> | ||
<template v-if="isOctokitInitialised"> | ||
<RouterView /> | ||
</template> | ||
</v-main> | ||
</v-app> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { defineStore } from "pinia"; | ||
import { ref } from "vue"; | ||
|
||
const useOctokitStore = defineStore("octokit", () => { | ||
const githubConfig = ref(null); | ||
const githubUserData = ref(null); | ||
const octokit = ref(null); | ||
|
||
function setOctokit(instance) { | ||
githubConfig.value = instance.githubConfig; | ||
githubUserData.value = instance.githubUserData; | ||
octokit.value = instance.octokit; | ||
} | ||
|
||
return { | ||
githubConfig, | ||
githubUserData, | ||
octokit, | ||
setOctokit, | ||
}; | ||
}); | ||
|
||
export default useOctokitStore; |