minor improvements

changed order in menu to make them consistent
This commit is contained in:
Vishal 2022-09-11 20:01:59 +05:30
parent 33e82ef74e
commit 985ffc89f2
3 changed files with 12 additions and 11 deletions

View File

@ -517,17 +517,13 @@ Future<void> channelMenuUI(Store node) async {
justShowedChannels = true;
}
int option = showMenu([ 'Show all public channels', // 1
'Enter a public channel', // 2
'Go back to main menu'], // 3
int option = showMenu([ 'Enter a public channel', // 1
'Show all public channels', // 2
'Go back to main menu'], // 3
"Public Channels Menu"); // name of menu
print('You picked: $option');
switch(option) {
case 1:
node.printAllChannelsInfo(1000, selectorShowAllRooms);
justShowedChannels = true;
break;
case 2:
justShowedChannels = false;
bool showChannelOption = true;
@ -579,6 +575,11 @@ Future<void> channelMenuUI(Store node) async {
}
break;
case 2:
node.printAllChannelsInfo(1000, selectorShowAllRooms);
justShowedChannels = true;
break;
case 3:
continueChatMenu = false;
break;

View File

@ -92,7 +92,7 @@ int gTextWidth = gDefaultTextWidth; // is changed by --width op
const int gSpacesPerDepth = 4; // constant
int gNumLeftMarginSpaces = 0;// this number is modified in main
String gAlignment = "center"; // is modified in main if --align argument is given
const int gapBetweenTopTrees = 2;
const int gapBetweenTopTrees = 1;
const int gNameLengthInPost = 12;
// after depth of maxDepthAllowed the thread is re-aligned to left by leftShiftThreadBy

View File

@ -1052,11 +1052,11 @@ class Store {
continue;
}
for( int i = 0; i < gapBetweenTopTrees - 1; i++ ) {
for( int i = 0; i < gapBetweenTopTrees; i++ ) {
stdout.write("\n");
}
printTopPost(topPosts[i], depth + 1, newerThan);
numPrinted += printTopPost(topPosts[i], depth + 1, newerThan);
}
if( numPrinted > 0)
@ -1717,7 +1717,7 @@ Store getTree(Set<Event> events) {
if( gDebug > 0) log.info("kind 3 finished.");
// remove bot events
events.removeWhere( (event) => gBots.contains(event.eventData.pubkey));
//events.removeWhere( (event) => gBots.contains(event.eventData.pubkey));
// remove duplicate events
Set ids = {};