mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
chore: disable pwa on mirror site (#7413)
* chore: disable pwa on mirror site * chore: disable pwa on mirror site
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user