MM-22963 Fix Android post GIF from keyboard (#3996)
This commit is contained in:
parent
06f03d88e9
commit
6eb7b5d682
1 changed files with 9 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ import com.mattermost.share.RealPathUtil;
|
|||
import com.mattermost.share.ShareModule;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.regex.Matcher;
|
||||
|
|
@ -133,9 +134,16 @@ public class RNPasteableEditTextOnPasteListener implements RNEditTextOnPasteList
|
|||
|
||||
private String moveToImagesCache(String src, String fileName) {
|
||||
ReactContext ctx = (ReactContext)mEditText.getContext();
|
||||
String dest = ctx.getCacheDir().getAbsolutePath() + "/Images/" + fileName;
|
||||
String cacheFolder = ctx.getCacheDir().getAbsolutePath() + "/Images/";
|
||||
String dest = cacheFolder + fileName;
|
||||
File folder = new File(cacheFolder);
|
||||
|
||||
|
||||
try {
|
||||
if (!folder.exists()) {
|
||||
folder.mkdirs();
|
||||
}
|
||||
|
||||
Files.move(Paths.get(src), Paths.get(dest));
|
||||
} catch (Exception err) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue