Skip to content

Commit

Permalink
fix: Fix it still continue cooperation even has been canceled
Browse files Browse the repository at this point in the history
After request has been canceled by remote target, reset the notify id, then ignore accept action.

Log: Fix it still continue cooperation even has been canceled.
Bug: https://pms.uniontech.com/bug-view-291005.html
  • Loading branch information
re2zero committed Dec 5, 2024
1 parent 1a28c91 commit 7ea158a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/cooperation/core/net/helper/sharehelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ void ShareHelper::handleCancelCooperApply()
static QString body(tr("The other party has cancelled the connection request !"));
#ifdef linux
d->notifyMessage(body, {}, 3 * 1000);
d->notice->resetNotifyId();
#else
static QString title(tr("connect failed"));
d->taskDialog()->switchInfomationPage(title, body);
Expand Down
4 changes: 4 additions & 0 deletions src/lib/cooperation/core/net/linux/noticeutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ void NoticeUtil::closeNotification()
notifyIfc->call("CloseNotification", recvNotifyId);
}

void NoticeUtil::resetNotifyId()
{
recvNotifyId = 0;
}
1 change: 1 addition & 0 deletions src/lib/cooperation/core/net/linux/noticeutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class NoticeUtil : public QObject

void notifyMessage(const QString &title, const QString &body, const QStringList &actions, QVariantMap hitMap, int expireTimeout);
void closeNotification();
void resetNotifyId();

Q_SIGNALS:
void ActionInvoked(const QString &action);
Expand Down

0 comments on commit 7ea158a

Please sign in to comment.