5
56
Fork
You've already forked gamja
22

Dismiss error toast automatically after timeout #21

Open
d96b wants to merge 1 commit from d96b/feat/autodismiss into master AGit
pull from: d96b/feat/autodismiss
merge into: emersion:master
emersion:master
emersion:unnecessary-const
emersion:eslint-extra
First-time contributor
Copy link

Needed some minor rearchitecturing of how imports are managed.

Cons: CSP changes. The importmap cannot be in a separate file.

Needed some minor rearchitecturing of how imports are managed. Cons: CSP changes. The importmap cannot be in a separate file.
Needed some minor rearchitecturing of how imports are managed.
Cons: CSP changes. The importmap cannot be in a separate file.
@ -2230,2 +2230,4 @@
</div>
`;
// Auto-close error box after 5000 ms
useEffect(() => {
Owner
Copy link

We don't use functional hooks in gamja. It should be possible to achieve the same thing with lifecycle methods: https://preactjs.com/guide/v10/components/#lifecycle-methods

We don't use functional hooks in gamja. It should be possible to achieve the same thing with lifecycle methods: https://preactjs.com/guide/v10/components/#lifecycle-methods
Author
First-time contributor
Copy link

I'm not sure if I can insert lifecycle methods into here without touching a lot of code, as the docs appear to claim that lifecycle methods only work with class components (and class components are depreciated / not recommended / code smell in React).

I'm not sure if I can insert lifecycle methods into here without touching a lot of code, as the docs appear to claim that lifecycle methods only work with class components (and class components are depreciated / not recommended / code smell in React).
Owner
Copy link

Class components are deprecated with React, but they are supported with Preact. gamja uses exclusively class components, and only uses functional components when there is no need to keep state.

App is already a class component.

Class components are deprecated with React, but they are supported with Preact. gamja uses exclusively class components, and only uses functional components when there is no need to keep state. `App` is already a class component.
@ -3,3 +3,3 @@
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; frame-src 'none'; object-src 'none'; connect-src *;">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; frame-src 'none'; script-src 'self' 'sha256-ZeafWUhxdQLP3YNleZ4clVqV75+nYLKaHzqf9Z2DM60='; object-src 'none'; connect-src *;">
Owner
Copy link

lib/index.js isn't great and import maps would nicely allow us to import directly libraries, however I don't think it's worth it if we have to maintain this hash.

`lib/index.js` isn't great and import maps would nicely allow us to import directly libraries, however I don't think it's worth it if we have to maintain this hash.
Author
First-time contributor
Copy link

We could do unsafe-inline but that gives me the ick. As far as I can tell, there's no way to do import maps without unsafe-inline or a build step.

We could do `unsafe-inline` but that gives me the ick. As far as I can tell, there's no way to do import maps without `unsafe-inline` or a build step.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin +refs/pull/21/head:d96b/feat/autodismiss
git switch d96b/feat/autodismiss

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff d96b/feat/autodismiss
git switch d96b/feat/autodismiss
git rebase master
git switch master
git merge --ff-only d96b/feat/autodismiss
git switch d96b/feat/autodismiss
git rebase master
git switch master
git merge --no-ff d96b/feat/autodismiss
git switch master
git merge --squash d96b/feat/autodismiss
git switch master
git merge --ff-only d96b/feat/autodismiss
git switch master
git merge d96b/feat/autodismiss
git push origin master
Sign in to join this conversation.
No reviewers
No labels
bug
enhancement
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
emersion/gamja!21
Reference in a new issue
emersion/gamja
No description provided.
Delete branch "d96b/feat/autodismiss"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?