Skip to content

fix(notion): error when opening page created from form#9182

Merged
thomaslombart merged 2 commits intoraycast:mainfrom
erics118:notion/fix-open-page-error
Nov 13, 2023
Merged

fix(notion): error when opening page created from form#9182
thomaslombart merged 2 commits intoraycast:mainfrom
erics118:notion/fix-open-page-error

Conversation

@erics118
Copy link
Contributor

@erics118 erics118 commented Nov 9, 2023

Description

fixes the error when trying to open a a page that was just created from the Create Database Page command

Fix #9152

Screencast

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: notion Issues related to the notion extension OP is contributor The OP of the PR is a contributor of the extension labels Nov 9, 2023
@raycastbot
Copy link
Collaborator

raycastbot commented Nov 9, 2023

Thank you for your contribution! 🎉

🔔 @HenriChabrand @mathieudutour @metakirby5 @thomaslombart @bkeys818 @AlexIsMaking you might want to have a look.

@erics118 erics118 force-pushed the notion/fix-open-page-error branch from 78e0f56 to 7c19146 Compare November 9, 2023 19:11
title: "Open Page",
shortcut: { modifiers: ["cmd"], key: "o" },
onAction: () => handleOnOpenPage(page, useRecentPages().setRecentPage),
onAction: () => handleOnOpenPage(page, setRecentPage),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original error was that it broke the Rule of Hooks. Originally, useRecentPages (a hook) was called inside a function. Fix was just to call useRecentPages inside the component

@erics118 erics118 changed the title fix: error when opening page created from form fix(notion): error when opening page created from form Nov 10, 2023
Copy link
Contributor

@thomaslombart thomaslombart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@thomaslombart thomaslombart merged commit 8078e18 into raycast:main Nov 13, 2023
@raycastbot
Copy link
Collaborator

Published to the Raycast Store:
https://raycast.com/notion/notion

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@erics118 erics118 deleted the notion/fix-open-page-error branch November 13, 2023 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: notion Issues related to the notion extension OP is contributor The OP of the PR is a contributor of the extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Notion] Cannot open page after creating it

3 participants