mirror of
https://gitlab.com/comunic/comunicwatcher
synced 2024-12-24 12:38:55 +00:00
Move some code
This commit is contained in:
parent
1cbae38ee5
commit
f190572d42
@ -63,9 +63,7 @@ void APIRequest::onResponse()
|
||||
|
||||
// Check if login token was destroyed
|
||||
if(code == 412) {
|
||||
AccountHelper::RemoveLoginToken();
|
||||
RefreshService::stopService();
|
||||
LoginWindow().exec();
|
||||
RefreshService::signOutUser();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "accounthelper.h"
|
||||
#include "loginwindow.h"
|
||||
#include "refreshservice.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
@ -25,6 +27,13 @@ void RefreshService::stopService()
|
||||
svc = nullptr;
|
||||
}
|
||||
|
||||
void RefreshService::signOutUser()
|
||||
{
|
||||
AccountHelper::RemoveLoginToken();
|
||||
RefreshService::stopService();
|
||||
LoginWindow().exec();
|
||||
}
|
||||
|
||||
void RefreshService::connectedToWebSocket()
|
||||
{
|
||||
mNotifsHelper.getNewNotificationsNumbers();
|
||||
|
@ -20,6 +20,8 @@ public:
|
||||
static void startService();
|
||||
static void stopService();
|
||||
|
||||
static void signOutUser();
|
||||
|
||||
private slots:
|
||||
void connectedToWebSocket();
|
||||
void onNewNumberNotifications(NotificationsNumber number);
|
||||
|
Loading…
Reference in New Issue
Block a user