Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use useSettings hook in DefaultRedirectionSnackbar #2117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Apr 11, 2024

In cozy/cozy-client#1460 we implemented a new useSettings hook

This hook can be used in DefaultRedirectionSnackbar in order to simplify code and homogenize the way we access cozy-apps settings

### ✨ Features

*

### πŸ› Bug Fixes

*

### πŸ”§ Tech

* Refactor `DefaultRedirectionSnackbar` to use new `useSettings` hook

...homeSettings,
default_redirection_view_count: default_redirection_view_count
? default_redirection_view_count + 1
: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not see anymore this logic of setting 1 if there was no value before. Will it work ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed here and in cozy-client

Copy link
Member Author

Choose a reason for hiding this comment

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

Finally we did not include the default parameter option in the useSettings API, so I added the necessary code in this cozy-home PR

`cozy-client` has been upgraded to `46.9.0` to retrieve the new
useSettings hook

Related PR: cozy/cozy-client#1460
In cozy/cozy-client#1460 we implemented a new `useSettings` hook

This hook can be used in `DefaultRedirectionSnackbar` in order to
simplify code and homogenize the way we access cozy-apps settings
@Ldoppea Ldoppea changed the title feat: TEMP useSetting refactor: Use useSettings hook in DefaultRedirectionSnackbar Apr 19, 2024
Copy link

bundlemon bot commented Apr 19, 2024

BundleMon

Files updated (7)
Status Path Size Limits
βœ… vendors/home.(hash).js
1.41MB (+4KB +0.28%) 1.5MB
βœ… intents/home.(hash).js
21.86KB (-23B -0.1%) 35KB
βœ… app/home.(hash).js
36.12KB (-152B -0.41%) 50KB
βœ… services/updateAccounts/home.js
444.01KB (-20.84KB -4.48%) 465KB
βœ… services/softDeleteOrRestoreAccounts/home.js
446.83KB (-20.88KB -4.46%) 490KB
βœ… services/deleteAccounts/home.js
292.95KB (-21.04KB -6.7%) 500KB
βœ… services/myselfFromIdenties/home.js
217.26KB (-21.13KB -8.86%) 240KB
Unchanged files (6)
Status Path Size Limits
βœ… services/polyfillFetch/home.js
98.39KB 99KB
βœ… vendors-home.(hash).(hash).min.css
38.55KB 40KB
βœ… services/attributesHelpers/home.js
15.13KB 16KB
βœ… app-home.(hash).min.css
1.34KB 15KB
βœ… intents/index.html
648B 1KB
βœ… intents-home.(hash).min.css
158B 6KB

Total files change -80.05KB -2.55%

Final result: βœ…

View report in BundleMon website ➑️


Current branch size history | Target branch size history

@Ldoppea Ldoppea marked this pull request as ready for review April 19, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants