fix: update layout options after fetching settings

This commit is contained in:
Aaryan Khandelwal 2024-06-04 21:07:49 +05:30
parent 761c65830c
commit 2921f230bf
2 changed files with 29 additions and 28 deletions

View File

@ -40,8 +40,7 @@ export const NavbarIssueBoardView: FC<NavbarIssueBoardViewProps> = observer((pro
return (
<>
{issueLayoutViews &&
Object.keys(issueLayoutViews).map((key: string) => {
{Object.keys(issueLayoutViews).map((key: string) => {
const layoutKey = key as TIssueLayout;
if (layoutOptions[layoutKey]) {
return (

View File

@ -38,13 +38,15 @@ export class PublishListStore implements IPublishListStore {
*/
fetchPublishSettings = async (anchor: string) => {
try {
const publishSettings = await this.publishService.fetchPublishSettings(anchor);
const response = await this.publishService.fetchPublishSettings(anchor);
runInAction(() => {
if (publishSettings.anchor)
set(this.publishMap, [publishSettings.anchor], new PublishStore(this.store, publishSettings));
if (response.anchor && response.view_props) {
this.store.issueFilter.updateLayoutOptions(response?.view_props);
set(this.publishMap, [response.anchor], new PublishStore(this.store, response));
}
});
return publishSettings;
return response;
} catch (error) {
throw error;
}