1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-05 19:26:02 +02:00
This commit is contained in:
syuilo
2025-08-26 14:22:53 +09:00
parent 05cc8047fa
commit d5475d1ff6
7 changed files with 16 additions and 15 deletions

View File

@@ -140,15 +140,15 @@ function toggleDayOfWeek(ad, index) {
function add() {
ads.value.unshift({
id: null,
id: '',
memo: '',
place: 'square',
priority: 'middle',
ratio: 1,
url: '',
imageUrl: null,
expiresAt: null,
startsAt: null,
imageUrl: '',
expiresAt: new Date().toISOString(),
startsAt: new Date().toISOString(),
dayOfWeek: 0,
});
}
@@ -160,7 +160,7 @@ function remove(ad) {
}).then(({ canceled }) => {
if (canceled) return;
ads.value = ads.value.filter(x => x !== ad);
if (ad.id == null) return;
if (ad.id === '') return;
os.apiWithDialog('admin/ad/delete', {
id: ad.id,
}).then(() => {
@@ -170,7 +170,7 @@ function remove(ad) {
}
function save(ad) {
if (ad.id == null) {
if (ad.id === '') {
misskeyApi('admin/ad/create', {
...ad,
expiresAt: new Date(ad.expiresAt).getTime(),
@@ -207,7 +207,7 @@ function save(ad) {
}
function more() {
misskeyApi('admin/ad/list', { untilId: ads.value.reduce((acc, ad) => ad.id != null ? ad : acc).id, publishing: publishing }).then(adsResponse => {
misskeyApi('admin/ad/list', { untilId: ads.value.reduce((acc, ad) => ad.id !== '' ? ad : acc).id, publishing: publishing }).then(adsResponse => {
if (adsResponse == null) return;
ads.value = ads.value.concat(adsResponse.map(r => {
const exdate = new Date(r.expiresAt);