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

Add cookie for default signing profile #1146

Open
yzernik opened this issue Sep 2, 2021 · 2 comments · May be fixed by #1224
Open

Add cookie for default signing profile #1146

yzernik opened this issue Sep 2, 2021 · 2 comments · May be fixed by #1224
Labels

Comments

@yzernik
Copy link
Collaborator

yzernik commented Sep 2, 2021

Backend changes

Add two new routes to app.py to get and set the cookie:

  • get_default_signing_profile_id
  • set_default_signing_profile_id

Example of how to get and set cookie in flask: https://flask.palletsprojects.com/en/2.0.x/quickstart/#cookies

Frontend changes

Add two new functions to requests.js to request those endpoints:

  • getDefaultSigningProfileIdRequest
  • setDefaultSigningProfileIdRequest

Use getUserRequest as an example: https://github.com/yzernik/squeaknode/blob/f5b40054633b56b2713c3d8866f7193c6a0b9544/frontend/src/squeakclient/requests.js#L98-L104

Update MakeSqueakDialog.js component to get the profile id when component mounts, and set the profile id whenever the dropdown selection changes.

@yzernik
Copy link
Collaborator Author

yzernik commented Nov 11, 2021

This does not have to be a cookie. It can be a new field in the db "config" table: https://github.com/yzernik/squeaknode/blob/b0e438fc839b57d98421dd53f6c8f3c65fd49973/squeaknode/db/models.py#L184

@yzernik
Copy link
Collaborator Author

yzernik commented Mar 28, 2022

This can also be a field in the redux slice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant