mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-10 19:03:17 +02:00
Fix for extending array settings + card Image check
This commit is contained in:
@@ -93,7 +93,9 @@ export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
setFooterHtml(undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (window.fmExternal && window.fmExternal.getCardImage) {
|
||||
window.fmExternal.getCardImage(fmFilePath, {
|
||||
fmFilePath,
|
||||
date,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { SETTING_EXTENSIBILITY_SCRIPTS } from './../constants/settings';
|
||||
import { parseWinPath } from './parseWinPath';
|
||||
import { Telemetry } from './Telemetry';
|
||||
import { Notifications } from './Notifications';
|
||||
@@ -707,9 +708,24 @@ export class Settings {
|
||||
configJson,
|
||||
filePath
|
||||
);
|
||||
} else if (typeof configJson === 'string') {
|
||||
Settings.mergeStringArray(`${CONFIG_KEY}.${relSettingName}`, configJson);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the array setting in the global config
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
private static mergeStringArray(key: string, value: string) {
|
||||
// Merge the arrays
|
||||
Settings.globalConfig[key] = [...(Settings.globalConfig[key] || []), value];
|
||||
Settings.globalConfig[key] = Settings.globalConfig[key].filter((item: any, index: number) => {
|
||||
return Settings.globalConfig[key].indexOf(item) === index;
|
||||
}, Settings.globalConfig[key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the setting name is equal or starts with the reference setting name
|
||||
* @param value
|
||||
|
||||
Reference in New Issue
Block a user