fix: paste before copy resulted in value being undefined (#8954)

* fix: paste before copy resulted in value being undefined

* returns empty array on getCopiedWidget
This commit is contained in:
Aswath K 2021-11-05 15:08:46 +05:30 committed by GitHub
parent a8afe98a16
commit 4506766a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -707,6 +707,7 @@ export function calculateNewWidgetPosition(
*/
function* pasteWidgetSaga(action: ReduxAction<{ groupWidgets: boolean }>) {
let copiedWidgetGroups: CopiedWidgetGroup[] = yield getCopiedWidgets();
if (!copiedWidgetGroups.length) return;
const shouldGroup: boolean = action.payload.groupWidgets;
const newlyCreatedWidgetIds: string[] = [];

View File

@ -66,6 +66,7 @@ export const getCopiedWidgets = async () => {
log.error("An error occurred when fetching copied widget: ", error);
return;
}
return [];
};
export const setOnboardingState = async (onboardingState: boolean) => {