|
|
@@ -15,13 +15,17 @@ export default function useSaveProjectSettings() {
|
|
|
) => {
|
|
|
if (projectSettings) {
|
|
|
const currentSetting = projectSettings[key]
|
|
|
-
|
|
|
if (currentSetting !== newSetting) {
|
|
|
await saveProjectSettings(projectId, {
|
|
|
[key]: newSetting,
|
|
|
})
|
|
|
|
|
|
- setProjectSettings({ ...projectSettings, [key]: newSetting })
|
|
|
+ // rootDocId is used in our tsx and our endpoint, but rootDoc_id is used in our project $scope, etc
|
|
|
+ // as we use both namings in many files, and convert back and forth,
|
|
|
+ // its complicated to seperate and choose one name for all usages
|
|
|
+ // todo: make rootDocId or rootDoc_id consistent, and remove need for this/ other conversions
|
|
|
+ const settingsKey = key === 'rootDocId' ? 'rootDoc_id' : key
|
|
|
+ setProjectSettings({ ...projectSettings, [settingsKey]: newSetting })
|
|
|
}
|
|
|
}
|
|
|
}
|