summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2023-07-28 10:46:43 +0200
committerGitHub <noreply@github.com>2023-07-28 17:46:43 +0900
commit339086995f54197e84e9904e4778b355b02479a0 (patch)
tree9a3d616960842b7d8a88bebd6cd65f6ec52ea78a
parentUpdate CHANGELOG.md (diff)
downloadmisskey-339086995f54197e84e9904e4778b355b02479a0.tar.gz
misskey-339086995f54197e84e9904e4778b355b02479a0.tar.bz2
misskey-339086995f54197e84e9904e4778b355b02479a0.zip
chore(frontend): support Spotify for brainDiver (#11407)
* chore(frontend): support Spotify for brainDiver * no lowercase * album * syntax fix * Update packages/frontend/src/components/MkPostForm.vue Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * reformat --------- Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
-rw-r--r--packages/frontend/src/components/MkPostForm.vue27
1 files changed, 17 insertions, 10 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index f1eac354ea..afbec98d61 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -751,18 +751,25 @@ async function post(ev?: MouseEvent) {
claimAchievement('notes1');
}
- const text = postData.text?.toLowerCase() ?? '';
- if ((text.includes('love') || text.includes('❤')) && text.includes('misskey')) {
+ const text = postData.text ?? '';
+ const lowerCase = text.toLowerCase();
+ if ((lowerCase.includes('love') || lowerCase.includes('❤')) && lowerCase.includes('misskey')) {
claimAchievement('iLoveMisskey');
}
- if (
- text.includes('https://youtu.be/Efrlqw8ytg4'.toLowerCase()) ||
- text.includes('https://www.youtube.com/watch?v=Efrlqw8ytg4'.toLowerCase()) ||
- text.includes('https://m.youtube.com/watch?v=Efrlqw8ytg4'.toLowerCase()) ||
- text.includes('https://youtu.be/XVCwzwxdHuA'.toLowerCase()) ||
- text.includes('https://www.youtube.com/watch?v=XVCwzwxdHuA'.toLowerCase()) ||
- text.includes('https://m.youtube.com/watch?v=XVCwzwxdHuA'.toLowerCase())
- ) {
+ if ([
+ 'https://youtu.be/Efrlqw8ytg4',
+ 'https://www.youtube.com/watch?v=Efrlqw8ytg4',
+ 'https://m.youtube.com/watch?v=Efrlqw8ytg4',
+
+ 'https://youtu.be/XVCwzwxdHuA',
+ 'https://www.youtube.com/watch?v=XVCwzwxdHuA',
+ 'https://m.youtube.com/watch?v=XVCwzwxdHuA',
+
+ 'https://open.spotify.com/track/3Cuj0mZrlLoXx9nydNi7RB',
+ 'https://open.spotify.com/track/7anfcaNPQWlWCwyCHmZqNy',
+ 'https://open.spotify.com/track/5Odr16TvEN4my22K9nbH7l',
+ 'https://open.spotify.com/album/5bOlxyl4igOrp2DwVQxBco',
+ ].some(url => text.includes(url))) {
claimAchievement('brainDiver');
}