login for RN app

This commit is contained in:
seb
2026-07-19 23:42:17 +02:00
parent af9e072427
commit c5b2f06919
7 changed files with 199 additions and 29 deletions

View File

@@ -161,23 +161,9 @@ class ArtikelSearchPage extends Component {
});
};
restoreStoredQuery = (stored) => {
this.props.navigate(
buildSearchUrl(stored.target, stored.filter ?? '', stored.offset ?? 0),
{ replace: true },
);
};
componentDidMount() {
document.addEventListener('mousedown', preserveSearchFocus, true);
window.addEventListener('resize', this.handleWindowResize);
const query = queryFromParams(this.props.searchParams);
const stored = readArtikelQuery();
if (query.target.trim().length < 3 && stored?.target?.trim().length >= 3) {
this.restoreStoredQuery(stored);
}
}
componentWillUnmount() {
@@ -192,14 +178,6 @@ class ArtikelSearchPage extends Component {
const target = searchParams.get('target') ?? '';
const prevTarget = prev.get('target') ?? '';
if (target.trim().length < 3 && prevTarget.trim().length >= 3) {
const stored = readArtikelQuery();
if (stored?.target?.trim().length >= 3) {
this.restoreStoredQuery(stored);
return;
}
}
if (target !== prevTarget && target !== this.state.input) {
this.setState({ input: target });
}