mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: update layout options after fetching settings
This commit is contained in:
parent
761c65830c
commit
2921f230bf
@ -40,32 +40,31 @@ export const NavbarIssueBoardView: FC<NavbarIssueBoardViewProps> = observer((pro
|
||||
|
||||
return (
|
||||
<>
|
||||
{issueLayoutViews &&
|
||||
Object.keys(issueLayoutViews).map((key: string) => {
|
||||
const layoutKey = key as TIssueLayout;
|
||||
if (layoutOptions[layoutKey]) {
|
||||
return (
|
||||
<div
|
||||
key={layoutKey}
|
||||
className={`flex h-[28px] w-[28px] cursor-pointer items-center justify-center rounded-sm ${
|
||||
layoutKey === activeLayout
|
||||
? `bg-custom-background-80 text-custom-text-200`
|
||||
: `text-custom-text-300 hover:bg-custom-background-80`
|
||||
{Object.keys(issueLayoutViews).map((key: string) => {
|
||||
const layoutKey = key as TIssueLayout;
|
||||
if (layoutOptions[layoutKey]) {
|
||||
return (
|
||||
<div
|
||||
key={layoutKey}
|
||||
className={`flex h-[28px] w-[28px] cursor-pointer items-center justify-center rounded-sm ${
|
||||
layoutKey === activeLayout
|
||||
? `bg-custom-background-80 text-custom-text-200`
|
||||
: `text-custom-text-300 hover:bg-custom-background-80`
|
||||
}`}
|
||||
onClick={() => handleCurrentBoardView(layoutKey)}
|
||||
title={layoutKey}
|
||||
>
|
||||
<span
|
||||
className={`material-symbols-rounded text-[18px] ${
|
||||
issueLayoutViews[layoutKey]?.className ? issueLayoutViews[layoutKey]?.className : ``
|
||||
}`}
|
||||
onClick={() => handleCurrentBoardView(layoutKey)}
|
||||
title={layoutKey}
|
||||
>
|
||||
<span
|
||||
className={`material-symbols-rounded text-[18px] ${
|
||||
issueLayoutViews[layoutKey]?.className ? issueLayoutViews[layoutKey]?.className : ``
|
||||
}`}
|
||||
>
|
||||
{issueLayoutViews[layoutKey]?.icon}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
})}
|
||||
{issueLayoutViews[layoutKey]?.icon}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user