foldable devices adaptation

When the device is unfolded, scaleMode is “letterbox” . Fold the screen while the program is running. How to change scalemode to "zoomletter” while ensuring application continuity.
Here is config.lua
application =
{
content =
{
width = 750,
height = 1334,
scale = “letterbox”,
fps = 60,
},
}
if display.pixelWidth / display.pixelHeight < 750/1334 then
application.content.scale = “letterbox”
end