(cherry picked from commit aa6c1ff058)
Co-authored-by: Daniel Espino García <larkox@gmail.com>
This commit is contained in:
parent
f1a06396c6
commit
d75b854828
1 changed files with 2 additions and 5 deletions
|
|
@ -9,7 +9,6 @@ import {queryMyTeams} from '@queries/servers/team';
|
|||
import {isDMorGM} from '@utils/channel';
|
||||
import {logError} from '@utils/log';
|
||||
|
||||
import type {Model} from '@nozbe/watermelondb';
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
|
||||
export const deleteCategory = async (serverUrl: string, categoryId: string) => {
|
||||
|
|
@ -80,7 +79,6 @@ export async function addChannelToDefaultCategory(serverUrl: string, channel: Ch
|
|||
return {error: 'no current user id'};
|
||||
}
|
||||
|
||||
const models: Model[] = [];
|
||||
const categoriesWithChannels: CategoryWithChannels[] = [];
|
||||
|
||||
if (isDMorGM(channel)) {
|
||||
|
|
@ -100,11 +98,10 @@ export async function addChannelToDefaultCategory(serverUrl: string, channel: Ch
|
|||
cwc.channel_ids.unshift(channel.id);
|
||||
categoriesWithChannels.push(cwc);
|
||||
}
|
||||
|
||||
const ccModels = await prepareCategoryChannels(operator, categoriesWithChannels);
|
||||
models.push(...ccModels);
|
||||
}
|
||||
|
||||
const models = await prepareCategoryChannels(operator, categoriesWithChannels);
|
||||
|
||||
if (models.length && !prepareRecordsOnly) {
|
||||
await operator.batchRecords(models);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue