文件
mynode/packages/app-desktop/gui/NoteListHeader/utils/validateColumns.ts
chen 301194963b
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
feat: Initial clean release of CHM
2026-11-04 11:29:39 +08:00

31 行
824 B
TypeScript

import { NoteListColumns, defaultListColumns } from '@joplin/lib/services/plugins/api/noteListType';
export default (columns: NoteListColumns) => {
if (!columns || !columns.length) return defaultListColumns();
// There must be one column with flexible width
if (!columns.find(c => !c.width)) {
const newColumns = columns.slice();
newColumns[newColumns.length - 1] = {
...newColumns[newColumns.length - 1],
width: 0,
};
return newColumns;
}
// There can't be more than one column with flexible width
if (columns.filter(c => !c.width).length > 1) {
const newColumns = columns.slice();
for (let i = 0; i < newColumns.length; i++) {
const col = newColumns[i];
newColumns[i] = {
...col,
width: i === newColumns.length - 1 ? 0 : 100,
};
}
return newColumns;
}
return columns;
};