mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 13:13:08 +02:00
リファクタ等
This commit is contained in:
parent
10f9fd6146
commit
10cd4754fd
6 changed files with 15 additions and 12 deletions
|
@ -99,7 +99,8 @@ import { faHeart, faFlag, faLaugh } from '@fortawesome/free-regular-svg-icons';
|
|||
import MkModal from '@/components/ui/modal.vue';
|
||||
import Particle from '@/components/particle.vue';
|
||||
import * as os from '@/os';
|
||||
import { isDeviceTouch } from '../scripts/is-device-touch';
|
||||
import { isDeviceTouch } from '@/scripts/is-device-touch';
|
||||
import { isMobile } from '@/scripts/is-mobile';
|
||||
import { emojiCategories } from '@/instance';
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -322,7 +323,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
mounted() {
|
||||
if (!os.isMobile) {
|
||||
if (!isMobile && !isDeviceTouch) {
|
||||
this.$refs.search.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
|
|
|
@ -69,6 +69,7 @@ import { noteVisibilities } from '../../types';
|
|||
import * as os from '@/os';
|
||||
import { selectFile } from '@/scripts/select-file';
|
||||
import { notePostInterruptors, postFormActions } from '@/store';
|
||||
import { isMobile } from '@/scripts/is-mobile';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -554,7 +555,7 @@ export default defineComponent({
|
|||
localOnly: this.localOnly,
|
||||
visibility: this.visibility,
|
||||
visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined,
|
||||
viaMobile: os.isMobile
|
||||
viaMobile: isMobile
|
||||
};
|
||||
|
||||
// plugin
|
||||
|
|
|
@ -49,15 +49,16 @@ import { router } from '@/router';
|
|||
import { applyTheme } from '@/scripts/theme';
|
||||
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
|
||||
import { i18n } from '@/i18n';
|
||||
import { stream, isMobile, dialog, post } from '@/os';
|
||||
import { stream, dialog, post } from '@/os';
|
||||
import * as sound from '@/scripts/sound';
|
||||
import { $i, refreshAccount, login, updateAccount, signout } from '@/account';
|
||||
import { defaultStore, ColdDeviceStorage } from '@/store';
|
||||
import { fetchInstance, instance } from '@/instance';
|
||||
import { makeHotkey } from './scripts/hotkey';
|
||||
import { search } from './scripts/search';
|
||||
import { getThemes } from './theme-store';
|
||||
import { initializeSw } from './scripts/initialize-sw';
|
||||
import { makeHotkey } from '@/scripts/hotkey';
|
||||
import { search } from '@/scripts/search';
|
||||
import { isMobile } from '@/scripts/is-mobile';
|
||||
import { getThemes } from '@/theme-store';
|
||||
import { initializeSw } from '@/scripts/initialize-sw';
|
||||
|
||||
console.info(`Misskey v${version}`);
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@ import { resolve } from '@/router';
|
|||
import { $i } from '@/account';
|
||||
import { defaultStore } from '@/store';
|
||||
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
export const isMobile = /mobile|iphone|ipad|android/.test(ua);
|
||||
|
||||
export const stream = markRaw(new Stream());
|
||||
|
||||
export const pendingApiRequestsCount = ref(0);
|
||||
|
|
2
src/client/scripts/is-mobile.ts
Normal file
2
src/client/scripts/is-mobile.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
const ua = navigator.userAgent.toLowerCase();
|
||||
export const isMobile = /mobile|iphone|ipad|android/.test(ua);
|
|
@ -64,6 +64,7 @@ import { noteVisibilities } from '../../../types';
|
|||
import * as os from '@/os';
|
||||
import { selectFile } from '@/scripts/select-file';
|
||||
import { notePostInterruptors, postFormActions } from '@/store';
|
||||
import { isMobile } from '@/scripts/is-mobile';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
@ -541,7 +542,7 @@ export default defineComponent({
|
|||
localOnly: this.localOnly,
|
||||
visibility: this.visibility,
|
||||
visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined,
|
||||
viaMobile: os.isMobile
|
||||
viaMobile: isMobile
|
||||
};
|
||||
|
||||
// plugin
|
||||
|
|
Loading…
Reference in a new issue