Skip to content

Commit 9777847

Browse files
authored
chore: remove console and debugger to prod (AppFlowy-IO#9)
1 parent 1578ffd commit 9777847

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/application/database-yjs/dispatch.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2920,6 +2920,20 @@ export function useDeleteSelectOption(fieldId: string) {
29202920
columns.delete(columnIndex);
29212921
}
29222922
}
2923+
2924+
const filters = view?.get(YjsDatabaseKey.filters);
2925+
const filter = filters?.toArray().find((filter) => filter.get(YjsDatabaseKey.field_id) === fieldId);
2926+
2927+
if (filter) {
2928+
const content = filter?.get(YjsDatabaseKey.content);
2929+
const filterOptionIds = content?.split(',')?.filter((item) => item.trim() !== '') ?? [];
2930+
2931+
if (filterOptionIds.includes(optionId)) {
2932+
const newContent = filterOptionIds.filter((id) => id !== optionId).join(',');
2933+
2934+
filter.set(YjsDatabaseKey.content, newContent);
2935+
}
2936+
}
29232937
},
29242938
'deleteSelectOptionFromGroup'
29252939
);

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default defineConfig({
114114
sourcemap: true,
115115
minifyIdentifiers: false, // Disable identifier minification in development
116116
minifySyntax: false, // Disable syntax minification in development
117-
pure: !isDev ? ['console.log', 'console.debug', 'console.info', 'console.trace', 'console.warn'] : [],
117+
drop: !isDev ? ['console', 'debugger'] : [],
118118
},
119119
build: {
120120
target: `esnext`,

0 commit comments

Comments
 (0)