Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Composer/packages/client/src/pages/publish/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ const Publish: React.FC<PublishPageProps> = (props) => {
}
};

useEffect(() => {
// if url was wrong, redirect to all profiles page
const activeDialog = settings.publishTargets?.find(({ name }) => name === selectedTargetName);
if (!activeDialog && selectedTargetName !== 'all') {
navigateTo(`/bot/${projectId}/publish/all`);
}
}, [selectedTargetName, projectId, settings.publishTargets]);

useEffect(() => {
if (projectId) {
actions.getPublishTargetTypes();
Expand Down
3 changes: 2 additions & 1 deletion Composer/packages/client/src/store/action/publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import formatMessage from 'format-message';

import { ActionCreator } from '../types';
import filePersistence from '../persistence/FilePersistence';

import { ActionTypes } from './../../constants/index';
import httpClient from './../../utils/httpUtil';

export const getPublishTargetTypes: ActionCreator = async ({ dispatch }) => {
try {
const response = await httpClient.get(`/publish/types`);
Expand Down Expand Up @@ -121,6 +121,7 @@ export const getPublishStatus: ActionCreator = async ({ dispatch }, projectId, t

export const getPublishHistory: ActionCreator = async ({ dispatch }, projectId, target) => {
try {
await filePersistence.flush();
const response = await httpClient.get(`/publish/${projectId}/history/${target.name}`);
dispatch({
type: ActionTypes.GET_PUBLISH_HISTORY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class FilePersistence {
if (this._isFlushing) {
return new Promise((resolve) => {
const timer = setInterval(() => {
if (!this.isEmpty()) {
if (this.isEmpty()) {
clearInterval(timer);
resolve(true);
}
Expand Down