chore: disable pwa on mirror site (#7413)

* chore: disable pwa on mirror site

* chore: disable pwa on mirror site
This commit is contained in:
0song
2022-04-28 12:48:41 +08:00
committed by GitHub
parent 7e33c87fe8
commit 9fb5927d79

View File

@@ -17,11 +17,16 @@ import VPSponsors from './vp-sponsors.vue'
import VPReloadPrompt from './vp-reload-prompt.vue'
const USER_PREFER_GITHUB_PAGE = 'USER_PREFER_GITHUB_PAGE'
const [isSidebarOpen, toggleSidebar] = useToggle(false)
const { hasSidebar } = useSidebar()
const lang = useLang()
const mirrorUrl = 'element-plus.gitee.io'
const isMirrorUrl = () => {
if (!isClient) return
return window.location.hostname === mirrorUrl
}
useToggleWidgets(isSidebarOpen, () => {
if (!isClient) return
if (window.outerWidth >= breakpoints.lg) {
@@ -63,7 +68,7 @@ onMounted(async () => {
)
if (lang.value === 'zh-CN') {
if (location.host === 'element-plus.gitee.io') return
if (isMirrorUrl()) return
if (userPrefer.value) {
// no alert in the next 90 days
@@ -130,7 +135,7 @@ onMounted(async () => {
</template>
</VPContent>
<ClientOnly>
<VPReloadPrompt />
<VPReloadPrompt v-if="!isMirrorUrl()" />
</ClientOnly>
<Debug />
</div>