fix(workspaces): add int comparison

This commit is contained in:
Alex 2019-10-19 16:19:35 +01:00
parent b97ca2ec9b
commit 7f7ebb5367
1 changed files with 3 additions and 0 deletions

View File

@ -88,6 +88,9 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
std::sort(workspaces_.begin(),
workspaces_.end(),
[](const Json::Value &lhs, const Json::Value &rhs) {
if (lhs["name"].isInt() && rhs["name"].isInt()) {
return lhs["name"].asInt() < rhs["name"].asInt();
}
return lhs["name"].asString() < rhs["name"].asString();
});
}