marcelo-ochoa / sqlcl-docker-extension

Docker Extension for using an embedded version of Oracle SQLcl client tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When Docker Desktop is in dark mode start post method is called twice

marcelo-ochoa opened this issue · comments

Last commit fix zombies process when stop ttyd process when changing from dark/light mode.
Now is working properly but when Docker Desktop is configured in Dark mode I see than start post service is called twice:
2022/08/25 19:12:49 started ttyd with theme: {"background":"#F4F4F6","foreground":"#27343B","cursor":"#17191E","selection":"#6BC3F3"} 2022/08/25 19:12:49 started ttyd with theme: {"background":"#202C33","foreground":"#FFFFFF","cursor":"#C4D0DA","selection":"#6BC3F3"}
It seem that Docker Desktop first call start post service with light mode and immediately call again with dark setting.
When working in light mode this behavior is not experimented.
@benja-M-1 Did you have any idea of why this happen?
Marcelo.

Unfortunately I don't 😕 We will have a look when possible cc @lucbpz

Hi @marcelo-ochoa! We fixed an issue with our theme that was causing an extra render in some cases. Could you please update your docker-mui-theme dependency to our latest version (^0.0.9) and see if the issue is solved? Thanks!

It works!!
Included with latest image build 22.3.0.
Thanks a lot @lucbpz , best regards. Marcelo

@lucbpz I am trying to upgrade mui-theme to 0.0.9 at PGAdmin4 Desktop Extension and the code:

  const theme = useTheme();
  const isDarkModeEnabled = useMediaQuery('(prefers-color-scheme: dark)');

  useEffect(() => {
    let timer: number;
    console.log((isDarkModeEnabled) ? 'dark' : 'standard');

didn't work.
Using 0.0.7 it works, tested using latest 4.13.0 or 4.12.0.
PD: I added on last commit a log message to quick check with the extension in debug mode to see if it works: