new: make activated profile always in top
This commit is contained in:
@@ -76,7 +76,10 @@ class ProfileDao extends DatabaseAccessor<AppDatabase>
|
|||||||
}) {
|
}) {
|
||||||
return (profileEntries.select()
|
return (profileEntries.select()
|
||||||
..orderBy(
|
..orderBy(
|
||||||
[
|
[(tbl) => OrderingTerm(
|
||||||
|
expression: tbl.active,
|
||||||
|
mode: OrderingMode.desc,
|
||||||
|
),
|
||||||
(tbl) {
|
(tbl) {
|
||||||
final trafficRatio = (tbl.download + tbl.upload) / tbl.total;
|
final trafficRatio = (tbl.download + tbl.upload) / tbl.total;
|
||||||
final isExpired =
|
final isExpired =
|
||||||
@@ -90,8 +93,9 @@ class ProfileDao extends DatabaseAccessor<AppDatabase>
|
|||||||
},
|
},
|
||||||
switch (sort) {
|
switch (sort) {
|
||||||
ProfilesSort.name => (tbl) => OrderingTerm(
|
ProfilesSort.name => (tbl) => OrderingTerm(
|
||||||
expression: tbl.name,
|
expression: tbl.name,
|
||||||
mode: orderMap[sortMode]!,
|
mode: orderMap[sortMode]!,
|
||||||
|
|
||||||
),
|
),
|
||||||
ProfilesSort.lastUpdate => (tbl) => OrderingTerm(
|
ProfilesSort.lastUpdate => (tbl) => OrderingTerm(
|
||||||
expression: tbl.lastUpdate,
|
expression: tbl.lastUpdate,
|
||||||
|
|||||||
Reference in New Issue
Block a user