なんかもう色々変えた

This commit is contained in:
mattyatea 2023-09-18 21:47:39 +09:00
parent 984c8b73cc
commit 62b70f85f0
11 changed files with 43 additions and 7 deletions

View file

@ -130,6 +130,18 @@ const DESKTOP_THRESHOLD = 1100;
const MOBILE_THRESHOLD = 500;
onMounted(() => {
if (
window.navigator.connection.type === "cellular" &&
!defaultStore.state.enableUltimateDataSaverMode &&
defaultStore.state.enableCellularWithUltimateDataSaver
) {
defaultStore.state.enableDataSaverMode = true;
defaultStore.state.enableUltimateDataSaverMode = true;
} else if (window.navigator.connection.type !== "cellular" && window.navigator.connection.type !== "undefined" && defaultStore.state.enableDataSaverMode && defaultStore.state.enableCellularWithDataSaver) {
defaultStore.state.enableDataSaverMode = false;
defaultStore.state.enableUltimateDataSaverMode = true;
}
if (
window.navigator.connection.type === "cellular" &&
!defaultStore.state.enableDataSaverMode &&
@ -140,6 +152,9 @@ onMounted(() => {
} else if (window.navigator.connection.type !== "cellular" && window.navigator.connection.type !== "undefined" && defaultStore.state.enableDataSaverMode && defaultStore.state.enableCellularWithDataSaver) {
defaultStore.state.enableDataSaverMode = false;
}
if (defaultStore.state.enableUltimateDataSaverMode) {
defaultStore.state.enableDataSaverMode = true;
}
});
// UI deviceKind === 'desktop'
const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD);