Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rosekey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
freelynetwork
Rosekey
Commits
e3bad795
Commit
e3bad795
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
Revert "debug"
This reverts commit
fa514031
.
parent
1ba559a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/client/src/init.ts
+0
-30
0 additions, 30 deletions
packages/client/src/init.ts
with
0 additions
and
30 deletions
packages/client/src/init.ts
+
0
−
30
View file @
e3bad795
...
...
@@ -74,14 +74,12 @@ if (_DEV_) {
// タッチデバイスでCSSの:hoverを機能させる
document
.
addEventListener
(
'
touchend
'
,
()
=>
{},
{
passive
:
true
});
console
.
info
(
'
1
'
);
// 一斉リロード
reloadChannel
.
addEventListener
(
'
message
'
,
path
=>
{
if
(
path
!==
null
)
location
.
href
=
path
;
else
location
.
reload
();
});
console
.
info
(
'
2
'
);
//#region SEE: https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
// TODO: いつの日にか消したい
...
...
@@ -92,7 +90,6 @@ window.addEventListener('resize', () => {
document
.
documentElement
.
style
.
setProperty
(
'
--vh
'
,
`
${
vh
}
px`
);
});
//#endregion
console
.
info
(
'
3
'
);
// If mobile, insert the viewport meta tag
if
([
'
smartphone
'
,
'
tablet
'
].
includes
(
deviceKind
))
{
...
...
@@ -100,18 +97,15 @@ if (['smartphone', 'tablet'].includes(deviceKind)) {
viewport
.
setAttribute
(
'
content
'
,
`
${
viewport
.
getAttribute
(
'
content
'
)}
, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover`
);
}
console
.
info
(
'
4
'
);
//#region Set lang attr
const
html
=
document
.
documentElement
;
html
.
setAttribute
(
'
lang
'
,
lang
);
//#endregion
console
.
info
(
'
5
'
);
//#region loginId
const
params
=
new
URLSearchParams
(
location
.
search
);
const
loginId
=
params
.
get
(
'
loginId
'
);
console
.
info
(
'
6
'
,
loginId
);
if
(
loginId
)
{
const
target
=
getUrlWithoutLoginId
(
location
.
href
);
...
...
@@ -125,7 +119,6 @@ if (loginId) {
history
.
replaceState
({
misskey
:
'
loginId
'
},
''
,
target
);
}
console
.
info
(
'
7
'
);
//#endregion
...
...
@@ -134,14 +127,12 @@ if ($i && $i.token) {
if
(
_DEV_
)
{
console
.
log
(
'
account cache found. refreshing...
'
);
}
console
.
info
(
'
8
'
);
refreshAccount
();
}
else
{
if
(
_DEV_
)
{
console
.
log
(
'
no account cache found.
'
);
}
console
.
info
(
'
9
'
);
// 連携ログインの場合用にCookieを参照する
const
i
=
(
document
.
cookie
.
match
(
/igi=
(\w
+
)
/
)
||
[
null
,
null
])[
1
];
...
...
@@ -175,7 +166,6 @@ fetchInstanceMetaPromise.then(() => {
// Init service worker
initializeSw
();
});
console
.
info
(
'
10
'
);
const
app
=
createApp
(
window
.
location
.
search
===
'
?zen
'
?
defineAsyncComponent
(()
=>
import
(
'
@/ui/zen.vue
'
))
:
...
...
@@ -185,8 +175,6 @@ const app = createApp(
defineAsyncComponent
(()
=>
import
(
'
@/ui/universal.vue
'
)),
);
console
.
info
(
'
11
'
);
if
(
_DEV_
)
{
app
.
config
.
performance
=
true
;
}
...
...
@@ -203,16 +191,12 @@ widgets(app);
directives
(
app
);
components
(
app
);
console
.
info
(
'
12
'
);
const
splash
=
document
.
getElementById
(
'
splash
'
);
// 念のためnullチェック(HTMLが古い場合があるため(そのうち消す))
if
(
splash
)
splash
.
addEventListener
(
'
transitionend
'
,
()
=>
{
splash
.
remove
();
});
console
.
info
(
'
13
'
);
// https://github.com/misskey-dev/misskey/pull/8575#issuecomment-1114239210
// なぜかinit.tsの内容が2回実行されることがあるため、mountするdivを1つに制限する
const
rootEl
=
(()
=>
{
...
...
@@ -231,27 +215,19 @@ const rootEl = (() => {
return
rootEl
;
})();
console
.
info
(
'
14
'
);
app
.
mount
(
rootEl
);
console
.
info
(
'
15
'
);
// boot.jsのやつを解除
window
.
onerror
=
null
;
window
.
onunhandledrejection
=
null
;
reactionPicker
.
init
();
console
.
info
(
'
16
'
);
if
(
splash
)
{
splash
.
style
.
opacity
=
'
0
'
;
splash
.
style
.
pointerEvents
=
'
none
'
;
}
console
.
info
(
'
17
'
);
// クライアントが更新されたか?
const
lastVersion
=
localStorage
.
getItem
(
'
lastVersion
'
);
if
(
lastVersion
!==
version
)
{
...
...
@@ -271,8 +247,6 @@ if (lastVersion !== version) {
}
}
console
.
info
(
'
18
'
);
// NOTE: この処理は必ず↑のクライアント更新時処理より後に来ること(テーマ再構築のため)
watch
(
defaultStore
.
reactiveState
.
darkMode
,
(
darkMode
)
=>
{
applyTheme
(
darkMode
?
ColdDeviceStorage
.
get
(
'
darkTheme
'
)
:
ColdDeviceStorage
.
get
(
'
lightTheme
'
));
...
...
@@ -293,8 +267,6 @@ watch(lightTheme, (theme) => {
}
});
console
.
info
(
'
19
'
);
//#region Sync dark mode
if
(
ColdDeviceStorage
.
get
(
'
syncDeviceDarkMode
'
))
{
defaultStore
.
set
(
'
darkMode
'
,
isDeviceDarkmode
());
...
...
@@ -307,8 +279,6 @@ window.matchMedia('(prefers-color-scheme: dark)').addListener(mql => {
});
//#endregion
console
.
info
(
'
20
'
);
fetchInstanceMetaPromise
.
then
(()
=>
{
if
(
defaultStore
.
state
.
themeInitial
)
{
if
(
instance
.
defaultLightTheme
!=
null
)
ColdDeviceStorage
.
set
(
'
lightTheme
'
,
JSON5
.
parse
(
instance
.
defaultLightTheme
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment