Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Adds warning when files have unsaved changes #156

Merged
merged 3 commits into from
Dec 2, 2021

Conversation

joshnuss
Copy link
Contributor

@joshnuss joshnuss commented Mar 30, 2021

Displays a warning when there are unsaved changes and the user attempts to navigate away.
Fixes #117

Currently, if you have unsaved change and reload the tab or navigate away, you lose all your code.

What this PR does:

repl-demo.mp4
  • fires events add & remove when a file is added or removed, so that parent components in svelte/site can track changes
  • adds a * next to the name when file is unsaved
  • exports a function markSaved() for use by parent components in svelte/site.
  • handles onbeforeunload and checks if files are modified

It also adds changes to svelte/site which you can see here sveltejs/svelte#6153

@Conduitry Conduitry force-pushed the track-modifications branch from 8195826 to 074ddb7 Compare December 2, 2021 19:12
@Conduitry Conduitry force-pushed the track-modifications branch from 074ddb7 to 53e3628 Compare December 2, 2021 19:14
@Conduitry Conduitry merged commit 48b95bd into sveltejs:master Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert if repl hasn't been saved
3 participants