-
Notifications
You must be signed in to change notification settings - Fork 4
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
API mockup + save state #29
base: workflow
Are you sure you want to change the base?
Conversation
…o be connected to an API
The code changes include the addition of login and register API calls in the `login.js` and `register.js` files respectively. These API calls are implemented using the `authFetch` function and the appropriate endpoints from the `constants.js` file. The login API call handles the authentication process and saves the access token and profile data to the local storage. The register API call handles the registration process. These changes are made in preparation for future development that may require API integration. Note: The recent user commits and repository commits are not directly related to these code changes and are provided for context only.
✅ Deploy Preview for yeetsheet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This commit adds functionality to initialize the spreadsheet with data from IndexedDB or default data. It introduces a new function, `loadInitialData`, which retrieves cell values from IndexedDB and populates the spreadsheet with them. If a cell value is not found in IndexedDB, it defaults to an empty string. The initial data is then passed to the `spreadsheet` function to create and append the spreadsheet to the container. Additionally, the commit includes an auto-save feature that saves the spreadsheet state every 10 seconds. This ensures that any changes made to the spreadsheet are persisted in IndexedDB. The commit also removes unused code.
|
||
addCellTargetingEvents('#spreadsheetContainer table', (col, row, value) => { | ||
// Here you can put the save function with params for cell contents. | ||
console.log('save', col, row, value); | ||
const cellId = `cell-${row}-${col}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the save cell was already done in another way from someone else, did you change it by purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is merely a suggestion. We can revert to the old code if you want :)
}); | ||
|
||
// Auto-save every 10 seconds | ||
setInterval(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, I'm not sure they meant to save the whole spreadsheet every 10 seconds, or just the cell that is currently editing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WeronikaMartinsen what is your take on this? I don't see any reason not to save the state of the whole spreadsheet every 10 seconds. In the future the code could be extended to save more things on the page if needed as well. I just interpreted "Save state" as saving the state of the whole spreadsheet and not a single cell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielEkerhovd
Can you please resolve the conlflicts in this PR
This implements functions that potentially can be used with little tweaks to implement calls to an API.
In addition it adds save state functionality to main.js