Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
343
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
28
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
2a4f2fba
Commit
2a4f2fba
authored
3 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
refactor(client): use composition api
parent
990fef59
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/components/media-image.vue
+21
-41
21 additions, 41 deletions
packages/client/src/components/media-image.vue
with
21 additions
and
41 deletions
packages/client/src/components/media-image.vue
+
21
−
41
View file @
2a4f2fba
...
...
@@ -20,52 +20,32 @@
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
<
script
lang=
"ts"
setup
>
import
{
watch
}
from
'
vue
'
;
import
*
as
misskey
from
'
misskey-js
'
;
import
{
getStaticImageUrl
}
from
'
@/scripts/get-static-image-url
'
;
import
ImgWithBlurhash
from
'
@/components/img-with-blurhash.vue
'
;
import
*
as
os
from
'
@/
o
s
'
;
import
{
defaultStore
}
from
'
@/s
tore
'
;
export
default
defineComponent
({
components
:
{
ImgWithBlurhash
},
props
:
{
image
:
{
type
:
Object
,
required
:
true
},
raw
:
{
default
:
false
}
},
data
()
{
return
{
hide
:
true
,
};
},
computed
:
{
url
():
any
{
let
url
=
this
.
$store
.
state
.
disableShowingAnimatedImages
?
getStaticImageUrl
(
this
.
image
.
thumbnailUrl
)
:
this
.
image
.
thumbnailUrl
;
const
props
=
defineProps
<
{
image
:
misskey
.
entities
.
DriveFile
;
raw
?:
boolean
;
}
>
();
if
(
this
.
raw
||
this
.
$store
.
state
.
loadRawImages
)
{
url
=
this
.
image
.
url
;
}
let
hide
=
$ref
(
true
);
return
url
;
}
},
created
()
{
// Plugin:register_note_view_interruptor を使って書き換えられる可能性があるためwatchする
this
.
$watch
(
'
image
'
,
()
=>
{
this
.
hide
=
(
this
.
$store
.
state
.
nsfw
===
'
force
'
)
?
true
:
this
.
image
.
isSensitive
&&
(
this
.
$store
.
state
.
nsfw
!==
'
ignore
'
);
},
{
deep
:
true
,
immediate
:
true
,
});
}
,
const
url
=
(
props
.
raw
||
defaultStore
.
state
.
loadRawImages
)
?
props
.
image
.
url
:
defaultStore
.
state
.
disableShowingAnimatedImages
?
getStaticImageUrl
(
props
.
image
.
thumbnailUrl
)
:
props
.
image
.
thumbnailUrl
;
// Plugin:register_note_view_interruptor を使って書き換えられる可能性があるためwatchする
watch
(()
=>
props
.
image
,
()
=>
{
hide
=
(
defaultStore
.
state
.
nsfw
===
'
force
'
)
?
true
:
props
.
image
.
isSensitive
&&
(
defaultStore
.
state
.
nsfw
!==
'
ignore
'
);
},
{
deep
:
true
,
immediate
:
true
,
});
</
script
>
...
...
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