Make connections react on changes of users; this works wonderfully
This commit is contained in:
parent
08846e4cc2
commit
695e029147
4 changed files with 49 additions and 31 deletions
|
@ -19,14 +19,11 @@ import pruner from "../app/Pruner";
|
|||
import subscriptionManager from "../app/SubscriptionManager";
|
||||
import userManager from "../app/UserManager";
|
||||
|
||||
// TODO subscribe dialog:
|
||||
// - check/use existing user
|
||||
// - add baseUrl
|
||||
// TODO embed into ntfy server
|
||||
// TODO subscribe dialog check/use existing user
|
||||
// TODO make default server functional
|
||||
// TODO business logic with callbacks
|
||||
// TODO routing
|
||||
// TODO embed into ntfy server
|
||||
// TODO connection indicator in subscription list
|
||||
// TODO connectionmanager should react on users changes
|
||||
|
||||
const App = () => {
|
||||
console.log(`[App] Rendering main view`);
|
||||
|
@ -53,9 +50,7 @@ const App = () => {
|
|||
setSelectedSubscription(newSelected);
|
||||
};
|
||||
const handleRequestPermission = () => {
|
||||
notificationManager.maybeRequestPermission((granted) => {
|
||||
setNotificationsGranted(granted);
|
||||
})
|
||||
notificationManager.maybeRequestPermission(granted => setNotificationsGranted(granted));
|
||||
};
|
||||
const handlePrefsClick = () => {
|
||||
setPrefsOpen(true);
|
||||
|
@ -91,7 +86,7 @@ const App = () => {
|
|||
console.error(`[App] Error handling notification`, e);
|
||||
}
|
||||
};
|
||||
connectionManager.refresh(subscriptions, users, handleNotification);
|
||||
connectionManager.refresh(subscriptions, users, handleNotification); // Dangle
|
||||
}, [subscriptions, users]);
|
||||
useEffect(() => {
|
||||
const subscriptionId = (selectedSubscription) ? selectedSubscription.id : "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue