mirror of
https://gitlab.com/comunic/comunicwatcher
synced 2024-11-22 13:29:25 +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
|
// Check if login token was destroyed
|
||||||
if(code == 412) {
|
if(code == 412) {
|
||||||
AccountHelper::RemoveLoginToken();
|
RefreshService::signOutUser();
|
||||||
RefreshService::stopService();
|
|
||||||
LoginWindow().exec();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include "accounthelper.h"
|
||||||
|
#include "loginwindow.h"
|
||||||
#include "refreshservice.h"
|
#include "refreshservice.h"
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
@ -25,6 +27,13 @@ void RefreshService::stopService()
|
|||||||
svc = nullptr;
|
svc = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RefreshService::signOutUser()
|
||||||
|
{
|
||||||
|
AccountHelper::RemoveLoginToken();
|
||||||
|
RefreshService::stopService();
|
||||||
|
LoginWindow().exec();
|
||||||
|
}
|
||||||
|
|
||||||
void RefreshService::connectedToWebSocket()
|
void RefreshService::connectedToWebSocket()
|
||||||
{
|
{
|
||||||
mNotifsHelper.getNewNotificationsNumbers();
|
mNotifsHelper.getNewNotificationsNumbers();
|
||||||
|
@ -20,6 +20,8 @@ public:
|
|||||||
static void startService();
|
static void startService();
|
||||||
static void stopService();
|
static void stopService();
|
||||||
|
|
||||||
|
static void signOutUser();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void connectedToWebSocket();
|
void connectedToWebSocket();
|
||||||
void onNewNumberNotifications(NotificationsNumber number);
|
void onNewNumberNotifications(NotificationsNumber number);
|
||||||
|
Loading…
Reference in New Issue
Block a user