25 lines
914 B
TypeScript
25 lines
914 B
TypeScript
import { ref, computed } from 'vue';
|
|
import { getStore, setStore } from '@/utils/storage';
|
|
import { defineStore } from 'pinia';
|
|
import { localStorageKeys } from '@/constant/index';
|
|
|
|
// mr 详情页 文件变更
|
|
export const useMrChangeStore = defineStore('merge-change-db', () => {
|
|
// 记录正在添加 issue 的 diff 文件: `文件名-行号-左/右`
|
|
const addingDiscussionsFile = ref('');
|
|
// 记录 diff 文件是否折叠 issue
|
|
const foldDiscussionsFile = ref({ curClickFile: '', record: {} });
|
|
|
|
// 显示设置
|
|
const setting = getStore(localStorageKeys.merge_showformat_setting);
|
|
const mergeDiffOutputFormat = ref(setting ? setting.mergeDiffOutputFormat : 'side-by-side');
|
|
const ignore_whitespace_change = ref(setting ? setting.ignore_whitespace_change : false);
|
|
|
|
return {
|
|
addingDiscussionsFile,
|
|
foldDiscussionsFile,
|
|
mergeDiffOutputFormat,
|
|
ignore_whitespace_change
|
|
};
|
|
});
|