swパッケージに
This commit is contained in:
parent
8db1585f79
commit
6c2a27756c
30 changed files with 429 additions and 20 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import * as misskey from 'misskey-js';
|
||||
import { I18n } from '@/scripts/i18n';
|
||||
import { i18n } from '@/i18n';
|
||||
|
||||
/**
|
||||
* 投稿を表す文字列を取得します。
|
||||
* @param {*} note (packされた)投稿
|
||||
*/
|
||||
export const getNoteSummary = (note: misskey.entities.Note, i18n: I18n<any>): string => {
|
||||
export const getNoteSummary = (note: misskey.entities.Note): string => {
|
||||
if (note.deletedAt) {
|
||||
return `(${i18n.locale.deletedNote})`;
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ export const getNoteSummary = (note: misskey.entities.Note, i18n: I18n<any>): st
|
|||
// 返信のとき
|
||||
if (note.replyId) {
|
||||
if (note.reply) {
|
||||
summary += `\n\nRE: ${getNoteSummary(note.reply, i18n)}`;
|
||||
summary += `\n\nRE: ${getNoteSummary(note.reply)}`;
|
||||
} else {
|
||||
summary += '\n\nRE: ...';
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ export const getNoteSummary = (note: misskey.entities.Note, i18n: I18n<any>): st
|
|||
// Renoteのとき
|
||||
if (note.renoteId) {
|
||||
if (note.renote) {
|
||||
summary += `\n\nRN: ${getNoteSummary(note.renote, i18n)}`;
|
||||
summary += `\n\nRN: ${getNoteSummary(note.renote)}`;
|
||||
} else {
|
||||
summary += '\n\nRN: ...';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export async function initializeSw() {
|
|||
('serviceWorker' in navigator) &&
|
||||
('PushManager' in window) &&
|
||||
$i && $i.token) {
|
||||
navigator.serviceWorker.register(`/sw.js`);
|
||||
navigator.serviceWorker.register(`/sw.js`, { scope: '/', type: 'module' });
|
||||
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.active?.postMessage({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue