mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-09-20 14:34:55 +00:00
Fix scroll restoration
This commit is contained in:
@@ -571,7 +571,7 @@ export default function Editor() {
|
||||
useEffect(() => {
|
||||
document.title = "Editor | drawDB";
|
||||
|
||||
const loadLatestDiagram = () => {
|
||||
const loadLatestDiagram = async () => {
|
||||
db.diagrams
|
||||
.orderBy("lastModified")
|
||||
.last()
|
||||
@@ -595,7 +595,7 @@ export default function Editor() {
|
||||
});
|
||||
};
|
||||
|
||||
const loadDiagram = (id) => {
|
||||
const loadDiagram = async (id) => {
|
||||
db.diagrams
|
||||
.get(id)
|
||||
.then((diagram) => {
|
||||
@@ -625,7 +625,7 @@ export default function Editor() {
|
||||
});
|
||||
};
|
||||
|
||||
const loadTemplate = (id) => {
|
||||
const loadTemplate = async (id) => {
|
||||
db.templates
|
||||
.get(id)
|
||||
.then((diagram) => {
|
||||
|
@@ -236,6 +236,8 @@ function SurveyForm({ theme }) {
|
||||
export default function Survey() {
|
||||
const [theme, setTheme] = useState("");
|
||||
|
||||
useEffect(() => window.scroll(0, 0));
|
||||
|
||||
useEffect(() => {
|
||||
const t = localStorage.getItem("theme");
|
||||
setTheme(t);
|
||||
@@ -271,7 +273,7 @@ export default function Survey() {
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<div className="sm:py-3 py-5 md:px-8 px-20 flex justify-between items-center">
|
||||
<div className="flex items-center justify-start">
|
||||
<Link to="/">
|
||||
@@ -329,6 +331,6 @@ export default function Survey() {
|
||||
<div className="text-center text-sm py-3">
|
||||
© 2024 <strong>drawDB</strong> - All right reserved.
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user