Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
342
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
27
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
TransFem.org
Sharkey
Commits
fb364ce7
Commit
fb364ce7
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
fix of #8512
https://github.com/misskey-dev/misskey/pull/8512#issuecomment-1368553870
parent
605582f5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
packages/frontend/src/pizzax.ts
+8
-0
8 additions, 0 deletions
packages/frontend/src/pizzax.ts
packages/frontend/src/ui/classic.vue
+16
-14
16 additions, 14 deletions
packages/frontend/src/ui/classic.vue
packages/frontend/src/ui/universal.vue
+14
-12
14 additions, 12 deletions
packages/frontend/src/ui/universal.vue
with
38 additions
and
26 deletions
packages/frontend/src/pizzax.ts
+
8
−
0
View file @
fb364ce7
...
...
@@ -23,8 +23,13 @@ export class Storage<T extends StateDef> {
// TODO: これが実装されたらreadonlyにしたい: https://github.com/microsoft/TypeScript/issues/37487
public
readonly
state
:
{
[
K
in
keyof
T
]:
T
[
K
][
'
default
'
]
};
public
readonly
reactiveState
:
{
[
K
in
keyof
T
]:
Ref
<
T
[
K
][
'
default
'
]
>
};
public
readonly
ready
:
Promise
<
void
>
;
private
markAsReady
:
()
=>
void
=
()
=>
{};
constructor
(
key
:
string
,
def
:
T
)
{
this
.
ready
=
new
Promise
((
res
)
=>
{
this
.
markAsReady
=
res
;
});
this
.
key
=
key
;
this
.
keyForLocalStorage
=
'
pizzax::
'
+
key
;
this
.
def
=
def
;
...
...
@@ -72,6 +77,7 @@ export class Storage<T extends StateDef> {
}
}
localStorage
.
setItem
(
this
.
keyForLocalStorage
+
'
::cache::
'
+
$i
.
id
,
JSON
.
stringify
(
cache
));
this
.
markAsReady
();
});
},
1
);
// streamingのuser storage updateイベントを監視して更新
...
...
@@ -87,6 +93,8 @@ export class Storage<T extends StateDef> {
localStorage
.
setItem
(
this
.
keyForLocalStorage
+
'
::cache::
'
+
$i
.
id
,
JSON
.
stringify
(
cache
));
}
});
}
else
{
this
.
markAsReady
();
}
}
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/ui/classic.vue
+
16
−
14
View file @
fb364ce7
...
...
@@ -7,7 +7,7 @@
<XSidebar/>
</div>
<div
v-else
ref=
"widgetsLeft"
class=
"widgets left"
>
<XWidgets
place=
"left"
@
mounted=
"attachSticky(widgetsLeft)"
:classic=
"true"
/>
<XWidgets
place=
"left"
:classic=
"true"
@
mounted=
"attachSticky(widgetsLeft)"
/>
</div>
<main
class=
"main"
:style=
"
{ background: pageMetadata?.value?.bg }" @contextmenu.stop="onContextmenu">
...
...
@@ -17,7 +17,7 @@
</main>
<div
v-if=
"isDesktop"
ref=
"widgetsRight"
class=
"widgets right"
>
<XWidgets
:place=
"showMenuOnTop ? 'right' : null"
@
mounted=
"attachSticky(widgetsRight)"
:classic=
"true"
/>
<XWidgets
:place=
"showMenuOnTop ? 'right' : null"
:classic=
"true"
@
mounted=
"attachSticky(widgetsRight)"
/>
</div>
</div>
...
...
@@ -129,18 +129,20 @@ if (window.innerWidth < 1024) {
document
.
documentElement
.
style
.
overflowY
=
'
scroll
'
;
if
(
defaultStore
.
state
.
widgets
.
length
===
0
)
{
defaultStore
.
set
(
'
widgets
'
,
[{
name
:
'
calendar
'
,
id
:
'
a
'
,
place
:
null
,
data
:
{},
},
{
name
:
'
notifications
'
,
id
:
'
b
'
,
place
:
null
,
data
:
{},
},
{
name
:
'
trends
'
,
id
:
'
c
'
,
place
:
null
,
data
:
{},
}]);
}
defaultStore
.
ready
.
then
(()
=>
{
if
(
defaultStore
.
state
.
widgets
.
length
===
0
)
{
defaultStore
.
set
(
'
widgets
'
,
[{
name
:
'
calendar
'
,
id
:
'
a
'
,
place
:
null
,
data
:
{},
},
{
name
:
'
notifications
'
,
id
:
'
b
'
,
place
:
null
,
data
:
{},
},
{
name
:
'
trends
'
,
id
:
'
c
'
,
place
:
null
,
data
:
{},
}]);
}
});
onMounted
(()
=>
{
window
.
addEventListener
(
'
resize
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/ui/universal.vue
+
14
−
12
View file @
fb364ce7
...
...
@@ -113,18 +113,20 @@ mainRouter.on('change', () => {
document
.
documentElement
.
style
.
overflowY
=
'
scroll
'
;
if
(
defaultStore
.
state
.
widgets
.
length
===
0
)
{
defaultStore
.
set
(
'
widgets
'
,
[{
name
:
'
calendar
'
,
id
:
'
a
'
,
place
:
'
right
'
,
data
:
{},
},
{
name
:
'
notifications
'
,
id
:
'
b
'
,
place
:
'
right
'
,
data
:
{},
},
{
name
:
'
trends
'
,
id
:
'
c
'
,
place
:
'
right
'
,
data
:
{},
}]);
}
defaultStore
.
ready
.
then
(()
=>
{
if
(
defaultStore
.
state
.
widgets
.
length
===
0
)
{
defaultStore
.
set
(
'
widgets
'
,
[{
name
:
'
calendar
'
,
id
:
'
a
'
,
place
:
'
right
'
,
data
:
{},
},
{
name
:
'
notifications
'
,
id
:
'
b
'
,
place
:
'
right
'
,
data
:
{},
},
{
name
:
'
trends
'
,
id
:
'
c
'
,
place
:
'
right
'
,
data
:
{},
}]);
}
});
onMounted
(()
=>
{
if
(
!
isDesktop
.
value
)
{
...
...
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