Fix order of nodes in client

This commit is contained in:
Joscha 2020-02-11 16:44:31 +00:00
parent ae28d79b46
commit a546ce0334

View file

@ -60,7 +60,10 @@ newNode flags text children =
delete = 'd' `elem` flags delete = 'd' `elem` flags
reply = 'r' `elem` flags reply = 'r' `elem` flags
act = 'a' `elem` flags act = 'a' `elem` flags
pairedChildren = zip (map (T.pack . show) [(0::Integer)..]) children digits = length $ show $ length children
formatId :: Integer -> T.Text
formatId = T.justifyRight digits '0' . T.pack . show
pairedChildren = zip (map formatId [0..]) children
in Node text edit delete reply act $ Map.fromList pairedChildren in Node text edit delete reply act $ Map.fromList pairedChildren
emptyNode :: String -> T.Text -> Node emptyNode :: String -> T.Text -> Node