They are both correct sentences, but the meaning is very different. But maybe it's a bit clearer with a different example.

Ni scios morgaŭ, ĉu ŝi venos. = We don't know whether she will come or not, but tomorrow we will know.

"Ĉu Lidia estas alta?" "Ni scios morgaŭ, se ŝi venos." = If she comes, we will know tomorrow whether she is tall. If she doesn't come, we will not know whether she is tall.

An easy way to check: If you can switch "if" out for "whether" in the English sentence without it changing its meaning, you should use "ĉu" in Esperanto.

It's also worth noting that using "ĉu" is consistent with sentences like "Mi scias, kiel mi povas fari tion", "Mi ne scias, kie estas la necesejo", "Mi komprenas, kial tio estas malbona ideo", "Mi volas scii, kiom manĝas elefanto", etc.

In Esperanto the second parts of the sentences all start with a question word, and are in fact usually perfectly fine questions if you just add a question mark. (Kiel mi povas fari tion? Kie estas la necesejo? etc.) So why should that be any different with "Mi ne scias, ĉu ŝi ŝatas min"?

We don't do that in English with "ĉu" (unlike e.g. "I don't know where the toilet is"), but I think that's just because, unlike Esperanto, English doesn't have a question word for yes/no questions. So instead we use "whether" or "if". But if English had one, we'd probably use it for this too. I do know that Japanese also uses its question particle in these cases, for example.